+
+
## Swiper
### Props
@@ -56,6 +58,7 @@ When you use a vertical Swiper, be sure to set its height through the `--height`
| stuckAtBoundary | Whether to stuck at boundary in order to prevent white spaces. Only available when `loop` is `false` and `slideWidth` < 100. | `boolean` | `true` |
| trackOffset | The track offset in percentage | `number` | `0` |
| stopPropagation | Stop the propagation of some events. | `PropagationEvent[]` | `[]` | 5.28.0 |
+| docDirection | The document layout direction,only effective when the direction is set to `horizontal`. | `'ltr' \| 'rtl'` | `'ltr'` |
```ts
type PropagationEvent = 'mouseup' | 'mousemove' | 'mousedown'
diff --git a/src/components/swiper/index.zh.md b/src/components/swiper/index.zh.md
index 20d7d97ef2..9ccf0e1362 100644
--- a/src/components/swiper/index.zh.md
+++ b/src/components/swiper/index.zh.md
@@ -34,6 +34,8 @@
+
+
## Swiper
### 属性
@@ -54,6 +56,7 @@
| stuckAtBoundary | 是否在边界两边卡住,避免出现空白,仅在非 `loop` 模式且 `slideSize` < 100 时生效 | `boolean` | `true` |
| trackOffset | 滑块轨道整体的偏移量百分比 | `number` | `0` |
| stopPropagation | 阻止某些事件的冒泡 | `PropagationEvent[]` | `[]` | 5.28.0 |
+| docDirection | 文档排版方向,仅在 direction 为`horizontal`是生效 | `'ltr' \| 'rtl'` | `'ltr'` |
```ts
type PropagationEvent = 'mouseup' | 'mousemove' | 'mousedown'
diff --git a/src/components/swiper/swiper.tsx b/src/components/swiper/swiper.tsx
index f1c7797641..6eb83cb0f3 100644
--- a/src/components/swiper/swiper.tsx
+++ b/src/components/swiper/swiper.tsx
@@ -57,6 +57,7 @@ export type SwiperProps = {
rubberband?: boolean
stopPropagation?: PropagationEvent[]
children?: ReactElement | ReactElement[]
+ docDirection?: 'ltr' | 'rtl'
} & NativeProps<'--height' | '--width' | '--border-radius' | '--track-padding'>
const defaultProps = {
@@ -71,6 +72,7 @@ const defaultProps = {
stuckAtBoundary: true,
rubberband: true,
stopPropagation: [] as PropagationEvent[],
+ docDirection: 'ltr',
}
let currentUid: undefined | {}
@@ -85,6 +87,9 @@ export const Swiper = forwardRef