2018-07-20 08:13:21 +00:00
|
|
|
<cn>
|
|
|
|
#### 自定义分页
|
|
|
|
自定义分页展示。
|
|
|
|
</cn>
|
|
|
|
|
|
|
|
<us>
|
|
|
|
#### Custom Paging
|
|
|
|
Custom paging display
|
|
|
|
</us>
|
|
|
|
|
2019-10-09 10:32:23 +00:00
|
|
|
```tpl
|
2018-07-20 08:13:21 +00:00
|
|
|
<template>
|
|
|
|
<a-carousel arrows dotsClass="slick-dots slick-thumb">
|
|
|
|
<a slot="customPaging" slot-scope="props">
|
|
|
|
<img :src="getImgUrl(props.i)" />
|
|
|
|
</a>
|
2018-07-20 10:24:22 +00:00
|
|
|
<div v-for="item in 4">
|
|
|
|
<img :src="baseUrl+'abstract0'+item+'.jpg'" />
|
2018-07-20 08:13:21 +00:00
|
|
|
</div>
|
|
|
|
</a-carousel>
|
|
|
|
</template>
|
|
|
|
<script>
|
2019-09-28 12:45:07 +00:00
|
|
|
const baseUrl =
|
|
|
|
'https://raw.githubusercontent.com/vueComponent/ant-design-vue/master/components/vc-slick/assets/img/react-slick/';
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
baseUrl,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
getImgUrl(i) {
|
|
|
|
return `${baseUrl}abstract0${i + 1}.jpg`;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2018-07-20 08:13:21 +00:00
|
|
|
</script>
|
|
|
|
<style scoped>
|
2019-09-28 12:45:07 +00:00
|
|
|
/* For demo */
|
|
|
|
.ant-carousel >>> .slick-dots {
|
|
|
|
height: auto;
|
|
|
|
}
|
|
|
|
.ant-carousel >>> .slick-slide img {
|
|
|
|
border: 5px solid #fff;
|
2018-07-20 08:13:21 +00:00
|
|
|
display: block;
|
|
|
|
margin: auto;
|
|
|
|
max-width: 80%;
|
2019-09-28 12:45:07 +00:00
|
|
|
}
|
|
|
|
.ant-carousel >>> .slick-thumb {
|
|
|
|
bottom: -45px;
|
|
|
|
}
|
|
|
|
.ant-carousel >>> .slick-thumb li {
|
|
|
|
width: 60px;
|
|
|
|
height: 45px;
|
|
|
|
}
|
|
|
|
.ant-carousel >>> .slick-thumb li img {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
filter: grayscale(100%);
|
|
|
|
}
|
|
|
|
.ant-carousel >>> .slick-thumb li.slick-active img {
|
2018-07-20 08:13:21 +00:00
|
|
|
filter: grayscale(0%);
|
2019-09-28 12:45:07 +00:00
|
|
|
}
|
2018-07-20 08:13:21 +00:00
|
|
|
</style>
|
|
|
|
```
|