From 6b351dbcbf244566daf9cc0f57512f7689689651 Mon Sep 17 00:00:00 2001 From: pengtikui <949828390@qq.com> Date: Fri, 21 Aug 2020 00:45:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(runtime):=20=E8=A1=8C=E5=86=85=E5=85=83?= =?UTF-8?q?=E7=B4=A0=E6=B7=BB=E5=8A=A0=20=20=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-runtime/src/dom/html/tags.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/taro-runtime/src/dom/html/tags.ts b/packages/taro-runtime/src/dom/html/tags.ts index 058d96838c48..0722abe16c34 100644 --- a/packages/taro-runtime/src/dom/html/tags.ts +++ b/packages/taro-runtime/src/dom/html/tags.ts @@ -25,7 +25,7 @@ const internalCompsList = Object.keys(internalComponents) export const isMiniElements = makeMap(internalCompsList, true) // https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements -export const isInlineElements = makeMap('a,i,abbr,iframe,select,acronym,slot,small,bdi,kbd,strong,big,map,sub,sup,br,mark,mark,meter,template,canvas,textarea,cite,object,time,code,output,u,data,picture,tt,datalist,var,dfn,del,q,em,s,embed,samp', true) +export const isInlineElements = makeMap('a,i,abbr,iframe,select,acronym,slot,small,bdi,kbd,strong,big,map,sub,sup,br,mark,mark,meter,template,canvas,textarea,cite,object,time,code,output,u,data,picture,tt,datalist,var,dfn,del,q,em,s,embed,samp,b', true) // https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements export const isBlockElements = makeMap('address,fieldset,li,article,figcaption,main,aside,figure,nav,blockquote,footer,ol,details,form,p,dialog,h1,h2,h3,h4,h5,h6,pre,dd,header,section,div,hgroup,table,dl,hr,ul,dt', true) From 57f764871c788705e9d1c63d0132bf3f68cbe75c Mon Sep 17 00:00:00 2001 From: pengtikui <949828390@qq.com> Date: Wed, 16 Sep 2020 00:09:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat(components):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F=20Swiper=20?= =?UTF-8?q?=E7=9A=84=20snap-to-edge=20=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/shared/src/components.ts | 1 + packages/taro-components/types/Swiper.d.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) 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 { /** 默认缓动函数 */