Showroom.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <article class="showroom">
  3. <section class="images" v-switcher>
  4. <!-- <figure v-html="item.field_visuels"></figure> -->
  5. <figure
  6. v-for="(img, index) in item.images"
  7. :key="img.url"
  8. class="lazy"
  9. v-lazy="index"
  10. >
  11. <img
  12. :data-src="img.style_showroomhome.url"
  13. @click="setLightBox(index)"
  14. />
  15. </figure>
  16. </section>
  17. <section class="content">
  18. <header>
  19. <h1>{{item.name}}</h1>
  20. </header>
  21. <section class="description" v-html="item.description" />
  22. <address>
  23. <span v-if="item.address.organization">{{ item.address.organization }}</br></span>
  24. <span v-if="item.address.address_line1">{{ item.address.address_line1 }}</br></span>
  25. <span v-if="item.address.locality">{{ item.address.locality }}</br></span>
  26. <span v-if="item.country.country_name">{{ item.country.country_name }}</span>
  27. </address>
  28. <div class="phone" v-html="item.phone" />
  29. <a class="email" :href="'mailto:'+item.email" v-html="item.email" />
  30. <div class="website">
  31. <a _target="_blank" :href="item.website.url">{{ item.website.title }}</a>
  32. </div>
  33. </section>
  34. </article>
  35. </template>
  36. <script>
  37. import { mapState, mapActions } from 'vuex'
  38. // import JSONAPI from 'vuejs/api/json-axios'
  39. import router from 'vuejs/route'
  40. import cardMixins from 'vuejs/components/cardMixins'
  41. let basePath = drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix;
  42. export default {
  43. name: "Showroom",
  44. router,
  45. mixins: [cardMixins],
  46. props: ['item'],
  47. // data(){
  48. // return {
  49. // alias: this.item.view_node.replace(/^.?\/showroom\//g, '')
  50. // }
  51. // },
  52. computed: {
  53. ...mapState({
  54. coolLightBoxItems: state => state.Common.coolLightBoxItems,
  55. coolLightBoxIndex: state => state.Common.coolLightBoxIndex
  56. }),
  57. },
  58. methods:{
  59. ...mapActions({
  60. setcoolLightBoxItems: 'Common/setcoolLightBoxItems',
  61. setcoolLightBoxIndex: 'Common/setcoolLightBoxIndex'
  62. }),
  63. setLightBox (index) {
  64. this.setcoolLightBoxItems(this.item.images)
  65. this.setcoolLightBoxIndex(index)
  66. }
  67. }
  68. }
  69. </script>
  70. <style lang="scss" scoped>
  71. </style>