Nominum.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <MainContentLayout id="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. </template>
  14. </MainContentLayout>
  15. </template>
  16. <script>
  17. import { REST } from 'api/rest-axios'
  18. import MainContentLayout from '../components/Layouts/MainContentLayout'
  19. import NominumItem from '../components/Content/NominumItem'
  20. export default {
  21. name: 'Nominum',
  22. components: {
  23. NominumItem,
  24. MainContentLayout
  25. },
  26. data: () => ({
  27. items: []
  28. }),
  29. beforeCreate () {
  30. // items/gdpLeMaire1685T01BodyFr01.003.016
  31. // texts/gdpSauval1724
  32. REST.get(`/indexNominum`, {})
  33. .then(({ data }) => {
  34. console.log('nominum REST: data', data)
  35. if (data.content.length) {
  36. this.items = data.content
  37. }
  38. })
  39. .catch((error) => {
  40. console.warn('Issue with nominum', error)
  41. Promise.reject(error)
  42. })
  43. }
  44. }
  45. </script>
  46. <style lang="scss" scoped>
  47. </style>