diff --git a/examples/demo-styles/carousel.scss b/examples/demo-styles/carousel.scss
index 02f137f04..dc5295a29 100644
--- a/examples/demo-styles/carousel.scss
+++ b/examples/demo-styles/carousel.scss
@@ -3,7 +3,7 @@
text-align: center;
border-right: solid 1px #eff2f6;
display: inline-block;
- width: 50%;
+ width: 49%;
box-sizing: border-box;
&:last-child {
border-right: none;
@@ -27,6 +27,14 @@
font-size: 18px;
line-height: 300px;
margin: 0;
+ &.small {
+ font-size: 14px;
+ line-height: 150px;
+ }
+ &.medium {
+ font-size: 14px;
+ line-height: 200px;
+ }
}
&:nth-child(2n) {
background-color: #99a9bf;
@@ -36,12 +44,3 @@
}
}
-.demo-carousel .small h3 {
- font-size: 14px;
- line-height: 150px;
-}
-
-.demo-carousel .medium h3 {
- font-size: 14px;
- line-height: 200px;
-}
diff --git a/examples/docs/en-US/carousel.md b/examples/docs/en-US/carousel.md
index e2b5f68b1..36ed9f980 100644
--- a/examples/docs/en-US/carousel.md
+++ b/examples/docs/en-US/carousel.md
@@ -11,7 +11,7 @@ Loop a series of images or texts in a limited space
Switch when indicator is hovered (default)
- {{ item }}
+ {{ item }}
@@ -19,7 +19,7 @@ Loop a series of images or texts in a limited space
Switch when indicator is clicked
- {{ item }}
+ {{ item }}
@@ -122,7 +122,7 @@ When a page is wide enough but has limited height, you can activate card mode fo
- {{ item }}
+ {{ item }}
@@ -147,6 +147,38 @@ When a page is wide enough but has limited height, you can activate card mode fo
```
:::
+By default, `direction` is `horizontal`. Let carousel be displayed in the vertical direction by setting `direction` to `vertical`.
+
+:::demo
+```html
+
+
+
+ {{ item }}
+
+
+
+
+
+```
+:::
+
### Carousel Attributes
| Attribute | Description | Type | Accepted Values | Default |
|---------- |-------------- |---------- |-------------------------------- |-------- |
@@ -159,6 +191,7 @@ When a page is wide enough but has limited height, you can activate card mode fo
| 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 |
+| direction | display direction | string | horizontal/vertical | horizontal |
### Carousel Events
| Event Name | Description | Parameters |
diff --git a/examples/docs/es/carousel.md b/examples/docs/es/carousel.md
index fa5d45458..b8d3a5e92 100644
--- a/examples/docs/es/carousel.md
+++ b/examples/docs/es/carousel.md
@@ -12,7 +12,7 @@ Presenta una serie de imágenes o textos en un espacio limitado
Switch when indicator is hovered (default)
- {{ item }}
+ {{ item }}
@@ -20,7 +20,7 @@ Presenta una serie de imágenes o textos en un espacio limitado
Switch when indicator is clicked
- {{ item }}
+ {{ item }}
@@ -126,7 +126,7 @@ Cuando una página es suficientemente ancha pero tiene una altura limitada, pued
- {{ item }}
+ {{ item }}
@@ -151,6 +151,38 @@ Cuando una página es suficientemente ancha pero tiene una altura limitada, pued
```
:::
+By default, `direction` is `horizontal`. Let carousel be displayed in the vertical direction by setting `direction` to `vertical`.
+
+:::demo
+```html
+
+
+
+ {{ item }}
+
+
+
+
+
+```
+:::
+
### Atributos de Carousel
| Atributo | Descripcion | Tipo | Valores aceptados | Por defecto |
| ------------------ | ---------------------------------------- | ------- | ------------------ | ----------- |
@@ -162,7 +194,8 @@ 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 se muestra cíclicamente | boolean | — | true |
+| loop | Si se muestra cíclicamente | boolean | — | true |
+| direction | display direction | string | horizontal/vertical| horizontal |
### Eventos de Carousel
| Nombre evento | Descripción | Parametros |
diff --git a/examples/docs/fr-FR/carousel.md b/examples/docs/fr-FR/carousel.md
index ba1e44ae0..9b36eff2c 100644
--- a/examples/docs/fr-FR/carousel.md
+++ b/examples/docs/fr-FR/carousel.md
@@ -11,7 +11,7 @@ Affiche en boucle une série d'images ou de textes dans un espace limité.
Défile quand la souris passe sur l'indicateur (défaut)
- {{ item }}
+ {{ item }}
@@ -19,7 +19,7 @@ Affiche en boucle une série d'images ou de textes dans un espace limité.
Défile quand on clique sur l'indicateur
- {{ item }}
+ {{ item }}
@@ -122,7 +122,7 @@ Quand la page est suffisement large mais avec une hauteur limitée, vous pouvez
- {{ item }}
+ {{ item }}
@@ -147,6 +147,38 @@ Quand la page est suffisement large mais avec une hauteur limitée, vous pouvez
```
:::
+By default, `direction` is `horizontal`. Let carousel be displayed in the vertical direction by setting `direction` to `vertical`.
+
+:::demo
+```html
+
+
+
+ {{ item }}
+
+
+
+
+
+```
+:::
+
### Attributs du Carousel
| Attribut | Description | Type | Valeurs acceptées | Défaut |
|---------- |-------------- |---------- |-------------------------------- |-------- |
@@ -159,6 +191,7 @@ Quand la page est suffisement large mais avec une hauteur limitée, vous pouvez
| arrow | Détermine quand les flèches sont affichés. | string | always/hover/never | hover |
| type | Type du carousel. | string | card | — |
| loop | Affiche les éléments en boucle. | boolean | - | true |
+| direction | display direction | string | horizontal/vertical | horizontal |
### Évènements du Carousel
| Nom | Description | Paramètres |
diff --git a/examples/docs/zh-CN/carousel.md b/examples/docs/zh-CN/carousel.md
index 12850f237..030926da3 100644
--- a/examples/docs/zh-CN/carousel.md
+++ b/examples/docs/zh-CN/carousel.md
@@ -13,7 +13,7 @@
默认 Hover 指示器触发
- {{ item }}
+ {{ item }}
@@ -21,7 +21,7 @@
Click 指示器触发
- {{ item }}
+ {{ item }}
@@ -122,7 +122,39 @@
- {{ item }}
+ {{ item }}
+
+
+
+
+
+```
+:::
+
+### 方向
+默认情况下,`direction` 为 `horizontal`。通过设置 `direction` 为 `vertical` 来让走马灯在垂直方向上显示。
+:::demo
+```html
+
+
+
+ {{ item }}
@@ -159,6 +191,7 @@
| arrow | 切换箭头的显示时机 | string | always/hover/never | hover |
| type | 走马灯的类型 | string | card | — |
| loop | 是否循环显示 | boolean | - | true |
+| direction | 走马灯展示的方向 | string | horizontal/vertical | horizontal |
### Carousel Events
| 事件名称 | 说明 | 回调参数 |
diff --git a/packages/carousel/src/item.vue b/packages/carousel/src/item.vue
index 1e2382b9d..907574e96 100644
--- a/packages/carousel/src/item.vue
+++ b/packages/carousel/src/item.vue
@@ -10,11 +10,7 @@
'is-animating': animating
}"
@click="handleItemClick"
- :style="{
- msTransform: `translateX(${ translate }px) scale(${ scale })`,
- webkitTransform: `translateX(${ translate }px) scale(${ scale })`,
- transform: `translateX(${ translate }px) scale(${ scale })`
- }">
+ :style="itemStyle">