Nominum.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. })
  52. }
  53. }
  54. </script>
  55. <style lang="scss" scoped>
  56. </style>