IndexNominum.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. metaInfo: {
  22. title: 'Index Nominum'
  23. },
  24. components: {
  25. NominumItem,
  26. MainContentLayout
  27. },
  28. data: () => ({
  29. items: []
  30. }),
  31. beforeCreate () {
  32. // items/gdpLeMaire1685T01BodyFr01.003.016
  33. // texts/gdpSauval1724
  34. REST.get(`${window.apipath}/indexNominum`, {})
  35. .then(({ data }) => {
  36. console.log('index nominum REST: data', data)
  37. if (data.content.length) {
  38. this.items = data.content
  39. }
  40. })
  41. .catch((error) => {
  42. console.warn('Issue with index nominum', error)
  43. Promise.reject(error)
  44. })
  45. }
  46. }
  47. </script>
  48. <style lang="scss" scoped>
  49. </style>