ant-design-vue/components/carousel/demo/customArrows.md

64 lines
1.2 KiB
Markdown
Raw Normal View History

2018-07-23 08:27:50 +00:00
<cn>
#### 自定义箭头
自定义箭头展示。
</cn>
<us>
#### Custom Arrows
Custom arrows display
</us>
```html
<template>
<a-carousel arrows>
2018-07-23 09:23:25 +00:00
<div
2019-09-28 12:45:07 +00:00
slot="prevArrow"
slot-scope="props"
2018-07-23 09:23:25 +00:00
class="custom-slick-arrow"
style="left: 10px;zIndex: 1"
>
<a-icon type="left-circle" />
</div>
2019-09-28 12:45:07 +00:00
<div slot="nextArrow" slot-scope="props" class="custom-slick-arrow" style="right: 10px">
2018-07-23 09:23:25 +00:00
<a-icon type="right-circle" />
</div>
2018-07-23 08:27:50 +00:00
<div><h3>1</h3></div>
<div><h3>2</h3></div>
<div><h3>3</h3></div>
<div><h3>4</h3></div>
</a-carousel>
</template>
<script>
2019-09-28 12:45:07 +00:00
export default {};
2018-07-23 08:27:50 +00:00
</script>
<style scoped>
2019-09-28 12:45:07 +00:00
/* For demo */
.ant-carousel >>> .slick-slide {
text-align: center;
height: 160px;
line-height: 160px;
background: #364d79;
overflow: hidden;
}
2018-07-23 08:27:50 +00:00
2019-09-28 12:45:07 +00:00
.ant-carousel >>> .custom-slick-arrow {
width: 25px;
height: 25px;
font-size: 25px;
color: #fff;
background-color: rgba(31, 45, 61, 0.11);
opacity: 0.3;
}
.ant-carousel >>> .custom-slick-arrow:before {
display: none;
}
.ant-carousel >>> .custom-slick-arrow:hover {
opacity: 0.5;
}
2018-07-23 08:27:50 +00:00
2019-09-28 12:45:07 +00:00
.ant-carousel >>> .slick-slide h3 {
color: #fff;
}
2018-07-23 08:27:50 +00:00
</style>
```