mirror of https://github.com/ElemeFE/element
Carousel: update doc and test for indicator labels (#4551)
parent
54e2047818
commit
72b1bc3c10
|
@ -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({
|
||||
|
|
Loading…
Reference in New Issue