Operum.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 v-html="content.title" />
  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. metaInfo () {
  27. return {
  28. title: `Operum ${this.$route.params.id}`
  29. }
  30. },
  31. beforeCreate () {
  32. console.log('operum this.$route', this.$route)
  33. REST.get(`${apipath}/indexOperum/` + this.$route.params.id, {})
  34. .then(({ data }) => {
  35. console.log('operum REST: data', data)
  36. if (data.content) {
  37. this.content = data.content
  38. }
  39. })
  40. .catch((error) => {
  41. console.warn('Issue with operum', error)
  42. Promise.reject(error)
  43. })
  44. }
  45. }
  46. </script>
  47. <style lang="scss" scoped>
  48. </style>