IndexNominum.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <MainContentLayout id="index-nominum" class="index">
  3. <template v-slot:header>
  4. <h1>Personnes</h1>
  5. <span v-if="!items.length">Loading ...</span>
  6. </template>
  7. <ul v-if="items.length" class="item-list">
  8. <li v-for="item in items" :key="item.url">
  9. <NominumItem :item="item" />
  10. </li>
  11. </ul>
  12. <template v-slot:nav />
  13. </MainContentLayout>
  14. </template>
  15. <script>
  16. import { REST } from 'api/rest-axios'
  17. import MainContentLayout from '../components/Layouts/MainContentLayout'
  18. import NominumItem from '../components/Content/NominumItem'
  19. export default {
  20. name: 'IndexNominum',
  21. components: {
  22. NominumItem,
  23. MainContentLayout
  24. },
  25. data: () => ({
  26. items: []
  27. }),
  28. beforeCreate () {
  29. // items/gdpLeMaire1685T01BodyFr01.003.016
  30. // texts/gdpSauval1724
  31. REST.get(`/indexNominum`, {})
  32. .then(({ data }) => {
  33. console.log('index nominum REST: data', data)
  34. if (data.content.length) {
  35. this.items = data.content
  36. }
  37. })
  38. .catch((error) => {
  39. console.warn('Issue with index nominum', error)
  40. Promise.reject(error)
  41. })
  42. }
  43. }
  44. </script>
  45. <style lang="scss" scoped>
  46. </style>