Operum.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <MainContentLayout id="operum" class="index-item">
  3. <template v-if="!content" v-slot:header>
  4. <span class="loading">Loading ...</span>
  5. </template>
  6. <template v-if="content" v-slot:header>
  7. <h1>{{ content.title }}</h1>
  8. </template>
  9. <!-- default slot -->
  10. <IndexItemOcurrences v-if="content" :content="content" />
  11. </MainContentLayout>
  12. </template>
  13. <script>
  14. import { REST } from 'api/rest-axios'
  15. import MainContentLayout from '../components/Layouts/MainContentLayout'
  16. import IndexItemOcurrences from '../components/Content/IndexItemOcurrences'
  17. export default {
  18. name: 'Operum',
  19. components: {
  20. MainContentLayout,
  21. IndexItemOcurrences
  22. },
  23. data: () => ({
  24. content: null
  25. }),
  26. beforeCreate () {
  27. console.log('operum this.$route', this.$route)
  28. REST.get(`/indexOperum/` + this.$route.params.id, {})
  29. .then(({ data }) => {
  30. console.log('operum REST: data', data)
  31. if (data.content) {
  32. this.content = data.content
  33. }
  34. })
  35. .catch((error) => {
  36. console.warn('Issue with operum', error)
  37. Promise.reject(error)
  38. })
  39. }
  40. }
  41. </script>
  42. <style lang="scss" scoped>
  43. </style>