Skip to content

Commit

Permalink
Merge pull request #7623 from pengtikui/next
Browse files Browse the repository at this point in the history
增加微信小程序 Swiper 的 snap-to-edge 属性
  • Loading branch information
Chen-jj authored Sep 24, 2020
2 parents 91ede02 + 734e0b8 commit c20b667
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/shared/src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
9 changes: 8 additions & 1 deletion packages/taro-components/types/Swiper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -117,7 +124,7 @@ declare namespace SwiperProps {
/** 其它原因 */
''
}

/** 指定 swiper 切换缓动动画类型 */
interface TEasingFunction {
/** 默认缓动函数 */
Expand Down

0 comments on commit c20b667

Please sign in to comment.