Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. <template>
  2. <slick class="SLIDERcontainer6_maincontainer" ref="slick" :options="slickOptions">
  3. <div class="SLIDERcontainer6_item_container" v-for="slider in globals.producsSlider" :key="slider.title">
  4. <div class="SLIDERcontainer6_item_image" :style="'background-image:url('+slider.image+');'"></div>
  5. </div>
  6. </slick>
  7. </template>
  8. <!--SCRIPTS-->
  9. <script>
  10. import { mapState } from 'vuex';
  11. import Slick from 'vue-slick';
  12. export default {
  13. name: 'SLIDERcontainer10',
  14.  
  15.  
  16. components: { Slick },
  17.  
  18.  
  19. computed:
  20. {
  21. ...mapState('Globals',['globals'])
  22. },
  23.  
  24.  
  25. data()
  26. {
  27. return {
  28. slickOptions: {
  29. infinite: true,
  30. slidesToShow: 4,
  31. slidesToScroll: 1,
  32. prevArrow: '<i class="fa fa-chevron-left fs_bigger c_light" style="position:absolute; left:10px; top:50%; transform:translateY(-50%); z-index:99999;"></i>',
  33. nextArrow: '<i class="fa fa-chevron-right fs_bigger c_light" style="position:absolute; right:10px; top:50%; transform:translateY(-50%); z-index:99999;"></i>',
  34. arrows: true,
  35. autoplay: true,
  36. speed: 2000,
  37. autoplaySpeed: 4000,
  38. responsive:
  39. [
  40. {
  41. breakpoint: 1120,
  42. settings:
  43. {
  44. slidesToShow: 3,
  45. slidesToScroll: 1,
  46. }
  47. },
  48. {
  49. breakpoint: 800,
  50. settings:
  51. {
  52. slidesToShow: 2,
  53. slidesToScroll: 2
  54. }
  55. },
  56. {
  57. breakpoint: 600,
  58. settings:
  59. {
  60. slidesToShow: 1,
  61. slidesToScroll: 1
  62. }
  63. }]
  64. },
  65.  
  66. };
  67. },
  68.  
  69.  
  70. beforeUpdate()
  71. {
  72. if (this.$refs.slick) {
  73. this.$refs.slick.destroy();
  74. }
  75. },
  76.  
  77.  
  78. updated()
  79. {
  80. this.$nextTick(function () {
  81. if (this.$refs.slick) {
  82. this.$refs.slick.create(this.slickOptions);
  83. }
  84. });
  85. },
  86.  
  87.  
  88. mounted()
  89. {
  90. console.log(this.$options.name+' component successfully mounted');
  91.  
  92. },
  93.  
  94.  
  95. };
  96. </script>
  97. <!--STYLES-->
  98. <style scoped>
  99. .SLIDERcontainer6_maincontainer{width:100%; height:auto; position:relative;}
  100. .SLIDERcontainer6_item_container{width:33.33%; height:350px; display:flex; flex-direction:column; align-items:center; justify-content:center; background-color:var(--web_primary_color); position:relative;}
  101. .SLIDERcontainer6_item_image{width:275px; height:275px; border-radius:50%; background-size:cover; background-position:center; margin:auto; align-self:center;}
  102. @media only screen and (max-width: 736px)
  103. {
  104. }
  105. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement