Nominum.vue 1.4 KB

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