Operum.vue 1006 B

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