12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <template>
- <MainContentLayout id="locorum" class="index-item">
- <template v-if="!content" v-slot:header>
- <span class="loading">Loading ...</span>
- </template>
- <template v-if="content" v-slot:header>
- <h1 v-html="content.title" />
- <p>
- {{ content.type }}
- </p>
- </template>
- <!-- default slot -->
- <IndexItemOcurrences v-if="content" :content="content" />
- </MainContentLayout>
- </template>
- <script>
- import { REST } from 'api/rest-axios'
- import MainContentLayout from '../components/Layouts/MainContentLayout'
- import IndexItemOcurrences from '../components/Content/IndexItemOcurrences'
- export default {
- name: 'Locorum',
- components: {
- MainContentLayout,
- IndexItemOcurrences
- },
- data: () => ({
- content: null
- }),
- metaInfo () {
- return {
- title: `Locorum ${this.$route.params.id}`
- }
- },
- computed: {
- },
- beforeCreate () {
- console.log('locorum this.$route', this.$route)
- REST.get(`${window.apipath}/indexLocorum/` + this.$route.params.id, {})
- .then(({ data }) => {
- console.log('locorum REST: data', data)
- if (data.content) {
- this.content = data.content
- }
- })
- .catch((error) => {
- console.warn('Issue with locorum', error)
- Promise.reject(error)
- this.$router.replace({
- name: 'notfound',
- query: { fullpath: this.$route.path }
- })
- })
- }
- }
- </script>
- <style lang="scss" scoped>
- </style>
|