Locorum.vue 1001 B

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