slider.vue 1.02 KB
<template>
    <cube-slide ref="slide" :data="list">
      <cube-slide-item v-for="(item, index) in list" :key="index">
        <ImageFormat @click="clickHandler(item, index)" :lazy="false" class="item-imge" :src="item.src" :width="750" :height="200"></ImageFormat>
      </cube-slide-item>
    </cube-slide>
</template>

<script>
import Vue from 'vue'
import { Style, Slide } from 'cube-ui';
import ImgSize from '../../../../components/img-size';
// import { createNamespacedHelpers } from 'vuex';
// const {mapState} = createNamespacedHelpers('channel');

export default {
  name: 'slide',
  props: {
    list: {
      type: Array,
      default: true
    },
  },
  data() {
    return {
      
    }
  },
  components: {
    Style,
    Slide,
    cubeSlide: Slide,
    cubeSlideItem: Slide.Item,
    ImgSize,
  },
  computed: {
    // ...mapState(['resource'])
  },
  methods: {
    clickHandler(item) {
      // console.log(item);
    }
  }
};
</script>

<style lang="scss" scoped>
.cube-slide {
  width: 100%;
  margin-bottom: 20px;
}
</style>