diff --git a/docs/en-US/component/carousel.md b/docs/en-US/component/carousel.md index 5fe455d7f5..85a788bfce 100644 --- a/docs/en-US/component/carousel.md +++ b/docs/en-US/component/carousel.md @@ -109,11 +109,12 @@ carousel/vertical ### Carousel Exposes -| Method | Description | Type | -| ------------- | ------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | -| setActiveItem | manually switch slide, index of the slide to be switched to, starting from 0; or the `name` of corresponding `el-carousel-item` | ^[Function]`(index: string \| number) => void` | -| prev | switch to the previous slide | ^[Function]`() => void` | -| next | switch to the next slide | ^[Function]`() => void` | +| Method | Description | Type | +| -------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | +| activeIndex ^(2.7.8) | active slide index | ^[number] | +| setActiveItem | manually switch slide, index of the slide to be switched to, starting from 0; or the `name` of corresponding `el-carousel-item` | ^[Function]`(index: string \| number) => void` | +| prev | switch to the previous slide | ^[Function]`() => void` | +| next | switch to the next slide | ^[Function]`() => void` | ## Carousel-Item API diff --git a/packages/components/carousel/__tests__/carousel.test.tsx b/packages/components/carousel/__tests__/carousel.test.tsx index 02ba376c01..3e692daf9b 100644 --- a/packages/components/carousel/__tests__/carousel.test.tsx +++ b/packages/components/carousel/__tests__/carousel.test.tsx @@ -343,4 +343,35 @@ describe('Carousel', () => { expect(items[0].classList.contains('is-active')).toBeTruthy() expect(container.style.height).toBe('100px') }) + + it('exposes', async () => { + const data = [100, 200, 300, 500] + + wrapper = mount({ + setup() { + return () => ( +