Locorum.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <MainContentLayout id="locorum" 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. <p>
  9. {{ content.type }}
  10. </p>
  11. </template>
  12. <!-- default slot -->
  13. <IndexItemOcurrences v-if="content" :content="content" />
  14. </MainContentLayout>
  15. </template>
  16. <script>
  17. import { REST } from 'api/rest-axios'
  18. import MainContentLayout from '../components/Layouts/MainContentLayout'
  19. import IndexItemOcurrences from '../components/Content/IndexItemOcurrences'
  20. export default {
  21. name: 'Locorum',
  22. components: {
  23. MainContentLayout,
  24. IndexItemOcurrences
  25. },
  26. data: () => ({
  27. content: null
  28. }),
  29. metaInfo () {
  30. return {
  31. title: `Locorum ${this.$route.params.id}`
  32. }
  33. },
  34. computed: {
  35. },
  36. beforeCreate () {
  37. console.log('locorum this.$route', this.$route)
  38. REST.get(`${apipath}/indexLocorum/` + this.$route.params.id, {})
  39. .then(({ data }) => {
  40. console.log('locorum REST: data', data)
  41. if (data.content) {
  42. this.content = data.content
  43. }
  44. })
  45. .catch((error) => {
  46. console.warn('Issue with locorum', error)
  47. Promise.reject(error)
  48. })
  49. }
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. </style>