slider.vue
1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<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>