diff --git a/packages/shared/src/components.ts b/packages/shared/src/components.ts index 853bb2fbc7dd..e541be753edc 100644 --- a/packages/shared/src/components.ts +++ b/packages/shared/src/components.ts @@ -411,6 +411,7 @@ const Swiper = { vertical: 'false', 'previous-margin': '\'0px\'', 'next-margin': '\'0px\'', + 'snap-to-edge': 'false', 'display-multiple-items': '1', 'skip-hidden-item-layout': 'false', 'easing-function': singleQuote('default'), diff --git a/packages/taro-components/types/Swiper.d.ts b/packages/taro-components/types/Swiper.d.ts index 3a72aef8ec53..cdfd1b937c56 100644 --- a/packages/taro-components/types/Swiper.d.ts +++ b/packages/taro-components/types/Swiper.d.ts @@ -73,6 +73,13 @@ interface SwiperProps extends StandardProps { */ nextMargin?: string + /** + * 当 swiper-item 的个数大于等于 2,关闭 circular 并且开启 previous-margin 或 next-margin 的时候,可以指定这个边距是否应用到第一个、最后一个元素 + * @default false + * @supported weapp + */ + snapToEdge?: boolean + /** 同时显示的滑块数量 * @default 1 * @supported weapp, swan, tt, h5 @@ -117,7 +124,7 @@ declare namespace SwiperProps { /** 其它原因 */ '' } - + /** 指定 swiper 切换缓动动画类型 */ interface TEasingFunction { /** 默认缓动函数 */