Product.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <article class="product">
  3. <header>
  4. <h1 v-html="product.title"/>
  5. </header>
  6. <section class="content">
  7. <div class="description" v-html="product.body"/>
  8. </section>
  9. <aside v-if="!isAdherent">
  10. <div
  11. class="variation"
  12. v-for="variation in product.variations"
  13. :key="variation.id"
  14. >
  15. <div class="variation-description" v-html="variation.description"/>
  16. <button
  17. type="button"
  18. name="addtocart"
  19. @click.stop="checkaddtocart($event, variation.id)"
  20. >
  21. {{ $t('default.'+variation_btn_txt[variation.id]) }}
  22. </button>
  23. </div>
  24. <div v-if="product.id == 4">
  25. <a href="mailto:info@materio.com?subject=Multi-Joueurs" class="btn">
  26. {{ $t("default.Ask for a quote") }}
  27. </a>
  28. </div>
  29. </aside>
  30. </article>
  31. </template>
  32. <script>
  33. import router from 'vuejs/route'
  34. import productsMixins from 'vuejs/components/productsMixins'
  35. export default {
  36. name: "Product",
  37. router,
  38. props: ['product'],
  39. mixins: [productsMixins],
  40. data(){
  41. return {
  42. quantity: 1,
  43. // showLoginModal:false
  44. variation_btn_txt: {
  45. 3: 'Yeees!',
  46. 4: 'Yay!',
  47. 5: 'Great!',
  48. 6: 'OKAY!'
  49. }
  50. }
  51. },
  52. created(){
  53. console.log('this.product', this.product)
  54. }
  55. }
  56. </script>
  57. <style lang="scss" scoped>
  58. </style>