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

pull/4572/head
杨奕 2017-05-02 10:24:40 +08:00 committed by baiyaaaaa
parent 54e2047818
commit 72b1bc3c10
3 changed files with 18 additions and 0 deletions

View File

@ -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 | | Attribute | Description | Type | Accepted Values | Default |
|---------- |-------------- |---------- |-------------------------------- |-------- | |---------- |-------------- |---------- |-------------------------------- |-------- |
| name | name of the item, can be used in `setActiveItem` | string | — | — | | name | name of the item, can be used in `setActiveItem` | string | — | — |
| label | text content for the corresponding indicator | string | — | — |

View File

@ -236,3 +236,4 @@
| 参数 | 说明 | 类型 | 可选值 | 默认值 | | 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------- |-------------- |---------- |-------------------------------- |-------- | |---------- |-------------- |---------- |-------------------------------- |-------- |
| name | 幻灯片的名字,可用作 `setActiveItem` 的参数 | string | — | — | | name | 幻灯片的名字,可用作 `setActiveItem` 的参数 | string | — | — |
| label | 该幻灯片所对应指示器的文本 | string | — | — |

View File

@ -113,6 +113,22 @@ describe('Carousel', () => {
}, 60); }, 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', () => { describe('manual control', () => {
it('hover', done => { it('hover', done => {
vm = createVue({ vm = createVue({