Commit 72b1bc3c authored by 杨奕's avatar 杨奕 Committed by baiyaaaaa

Carousel: update doc and test for indicator labels (#4551)

parent 54e20478
......@@ -187,3 +187,4 @@ When a page is wide enough but has limited height, you can activate card mode fo
| Attribute | Description | Type | Accepted Values | Default |
|---------- |-------------- |---------- |-------------------------------- |-------- |
| name | name of the item, can be used in `setActiveItem` | string | — | — |
| label | text content for the corresponding indicator | string | — | — |
......@@ -236,3 +236,4 @@
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------------- |---------- |-------------------------------- |-------- |
| name | 幻灯片的名字,可用作 `setActiveItem` 的参数 | string | — | — |
| label | 该幻灯片所对应指示器的文本 | string | — | — |
......@@ -113,6 +113,22 @@ describe('Carousel', () => {
}, 60);
});
it('label', done => {
vm = createVue({
template: `
<div>
<el-carousel>
<el-carousel-item v-for="item in 3" :key="item" :label="item"></el-carousel-item>
</el-carousel>
</div>
`
});
setTimeout(_ => {
expect(vm.$el.querySelector('.el-carousel__button').innerText).to.equal('1');
done();
}, 10);
});
describe('manual control', () => {
it('hover', done => {
vm = createVue({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment