diff --git a/examples/docs/en-US/carousel.md b/examples/docs/en-US/carousel.md index 01efdc9cb..8d3919451 100644 --- a/examples/docs/en-US/carousel.md +++ b/examples/docs/en-US/carousel.md @@ -219,6 +219,7 @@ When a page is wide enough but has limited height, you can activate card mode fo | indicator-position | position of the indicators | string | outside/none | — | | arrow | when arrows are shown | string | always/hover/never | hover | | type | type of the Carousel | string | card | — | +| loop | display the items in loop | boolean | - | true | ### Carousel Events | Event Name | Description | Parameters | diff --git a/examples/docs/es/carousel.md b/examples/docs/es/carousel.md index e6ac85356..5f053e0df 100644 --- a/examples/docs/es/carousel.md +++ b/examples/docs/es/carousel.md @@ -223,6 +223,7 @@ Cuando una página es suficientemente ancha pero tiene una altura limitada, pued | indicator-position | Posición del indicador de paginación | string | outside/none | — | | arrow | Cuando se muestran las flechas | string | always/hover/never | hover | | type | Tipo de carrusel | string | card | — | +| loop | Si mostrar cíclicamente | boolean | — | true | ### Eventos de Carousel | Nombre evento | Descripción | Parametros | diff --git a/examples/docs/zh-CN/carousel.md b/examples/docs/zh-CN/carousel.md index d28da9783..bb1a33464 100644 --- a/examples/docs/zh-CN/carousel.md +++ b/examples/docs/zh-CN/carousel.md @@ -219,6 +219,7 @@ | indicator-position | 指示器的位置 | string | outside/none | — | | arrow | 切换箭头的显示时机 | string | always/hover/never | hover | | type | 走马灯的类型 | string | card | — | +| loop | 是否循环显示 | boolean | - | true | ### Carousel Events | 事件名称 | 说明 | 回调参数 | diff --git a/packages/carousel/src/item.vue b/packages/carousel/src/item.vue index 8bfe520f1..1e2382b9d 100644 --- a/packages/carousel/src/item.vue +++ b/packages/carousel/src/item.vue @@ -79,7 +79,7 @@ if (this.$parent.type !== 'card' && oldIndex !== undefined) { this.animating = index === activeIndex || index === oldIndex; } - if (index !== activeIndex && length > 2) { + if (index !== activeIndex && length > 2 && this.$parent.loop) { index = this.processIndex(index, activeIndex, length); } if (this.$parent.type === 'card') { diff --git a/packages/carousel/src/main.vue b/packages/carousel/src/main.vue index f33583649..3983ce4fc 100644 --- a/packages/carousel/src/main.vue +++ b/packages/carousel/src/main.vue @@ -11,7 +11,7 @@