Nominum.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. <!-- <ul v-if="content.attestedForms.lenght" class="attestedForms">
  13. <li v-for="(item, index) in content.attestedForms" :key="index">
  14. </li>
  15. </ul> -->
  16. </template>
  17. <!-- default slot -->
  18. <IndexItemOcurrences v-if="content" :content="content" />
  19. </MainContentLayout>
  20. </template>
  21. <script>
  22. import { REST } from 'api/rest-axios'
  23. import MainContentLayout from '../components/Layouts/MainContentLayout'
  24. import IndexItemOcurrences from '../components/Content/IndexItemOcurrences'
  25. export default {
  26. name: 'Nominum',
  27. components: {
  28. MainContentLayout,
  29. IndexItemOcurrences
  30. },
  31. data: () => ({
  32. content: null
  33. }),
  34. metaInfo () {
  35. return {
  36. title: `Nominum ${this.$route.params.id}`
  37. }
  38. },
  39. beforeCreate () {
  40. console.log('nominum this.$route', this.$route)
  41. REST.get(`${window.apipath}/indexNominum/` + this.$route.params.id, {})
  42. .then(({ data }) => {
  43. console.log('nominum REST: data', data)
  44. if (data.content) {
  45. this.content = data.content
  46. }
  47. })
  48. .catch((error) => {
  49. console.warn('Issue with nominum', error)
  50. Promise.reject(error)
  51. this.$router.replace({
  52. name: 'notfound',
  53. query: { fullpath: this.$route.path }
  54. })
  55. })
  56. }
  57. }
  58. </script>
  59. <style lang="scss" scoped>
  60. </style>