Skip to content

Commit 7355df0

Browse files
charleylla柏丘
and
柏丘
authored
feat: 为 Tabs 添加 catchTouchStart/catchTouchMove 属性 (#1350)
* feat: 为 Tabs 添加 catchTouchStart/catchTouchMove 属性 * feat: 为 Tabs 添加 catchTouchStart/catchTouchMove 属性 --------- Co-authored-by: 柏丘 <[email protected]>
1 parent 8b66127 commit 7355df0

File tree

121 files changed

+471
-435
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+471
-435
lines changed

compiled/alipay/src/Tabs/index.axml

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
scrollX="{{true}}"
2424
scrollWithAnimation="{{true}}"
2525
scrollAnimationDuration="{{300}}"
26+
catchTouchStart="{{catchTouchStart}}"
27+
catchTouchMove="{{catchTouchMove}}"
2628
>
2729
<view></view>
2830
<block
@@ -117,6 +119,8 @@
117119
scrollY="{{true}}"
118120
scrollWithAnimation="{{true}}"
119121
scrollAnimationDuration="{{300}}"
122+
catchTouchStart="{{catchTouchStart}}"
123+
catchTouchMove="{{catchTouchMove}}"
120124
>
121125
<view class="ant-vtabs-bar-item-wrap">
122126
<block

compiled/alipay/src/Tabs/props.ts

+12
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ export interface ITabsProps extends IBaseProps {
5555
*@description tab active类名
5656
*/
5757
tabActiveClassName?: string;
58+
59+
/**
60+
* swiper 嵌套场景下,是否组织 Tab 的 touch 事件冒泡:https://opendocs.alipay.com/mini/component/scroll-view
61+
* @description catchTouchStart
62+
*/
63+
catchTouchStart?: boolean;
64+
65+
/**
66+
* swiper 嵌套场景下,是否组织 Tab 的 touch 事件冒泡:https://opendocs.alipay.com/mini/component/scroll-view
67+
* @description catchTouchMove
68+
*/
69+
catchTouchMove?: boolean;
5870
}
5971

6072
export const TabsDefaultProps: Partial<ITabsProps> = {

compiled/wechat/demo/pages/ActionSheet/index.wxml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
<ant-container title="基础用法">
22
<ant-button
3-
bind:tap="handleOpenBasic"
3+
bindtap="handleOpenBasic"
44
inline="{{true}}"
55
size="large"
66
data-index="1"
77
>基础用法</ant-button>
88
</ant-container>
99
<ant-container title="选项状态">
1010
<ant-button
11-
bind:tap="handleOpenBasic"
11+
bindtap="handleOpenBasic"
1212
inline="{{true}}"
1313
size="large"
1414
data-index="2"
1515
>危险状态&禁用状态</ant-button>
1616
</ant-container>
1717
<ant-container title="带注释及icon">
1818
<ant-button
19-
bind:tap="handleOpenBasic"
19+
bindtap="handleOpenBasic"
2020
inline="{{true}}"
2121
size="large"
2222
data-index="3"

compiled/wechat/demo/pages/Button/index.wxml

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
>
55
<ant-button
66
type="primary"
7-
bind:tap="handleTap"
7+
bindtap="handleTap"
88
>主要按钮</ant-button>
99
<ant-button
1010
type="default"
11-
bind:tap="handleTap"
11+
bindtap="handleTap"
1212
>次要按钮</ant-button>
1313
<ant-button
1414
type="text"
15-
bind:tap="handleTap"
15+
bindtap="handleTap"
1616
>文本按钮</ant-button>
1717
</ant-container>
1818
<ant-container
@@ -22,17 +22,17 @@
2222
<ant-button
2323
type="primary"
2424
subText="副标题"
25-
bind:tap="handleTap"
25+
bindtap="handleTap"
2626
>主要按钮</ant-button>
2727
<ant-button
2828
type="default"
2929
subText="副标题"
30-
bind:tap="handleTap"
30+
bindtap="handleTap"
3131
>次要按钮</ant-button>
3232
<ant-button
3333
type="text"
3434
subText="副标题"
35-
bind:tap="handleTap"
35+
bindtap="handleTap"
3636
>文本按钮</ant-button>
3737
</ant-container>
3838
<ant-container
@@ -76,16 +76,16 @@
7676
<ant-button
7777
type="primary"
7878
danger
79-
bind:tap="handleTap"
79+
bindtap="handleTap"
8080
>主要按钮</ant-button>
8181
<ant-button
8282
type="default"
8383
danger
84-
bind:tap="handleTap"
84+
bindtap="handleTap"
8585
>次要按钮</ant-button>
8686
<ant-button
8787
type="text"
8888
danger
89-
bind:tap="handleTap"
89+
bindtap="handleTap"
9090
>文本按钮</ant-button>
9191
</ant-container>

compiled/wechat/demo/pages/ButtonCustom/index.wxml

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
<ant-button
66
type="primary"
77
icon="SmileOutline"
8-
bind:tap="handleTap"
8+
bindtap="handleTap"
99
className="btn"
1010
>主要按钮</ant-button>
1111
<ant-button
1212
type="primary"
13-
bind:tap="handleTap"
13+
bindtap="handleTap"
1414
icon="SmileOutline"
1515
className="btn"
1616
inline
1717
>主要按钮</ant-button>
1818
<ant-button
1919
type="primary"
20-
bind:tap="handleTap"
20+
bindtap="handleTap"
2121
icon="ForbidFill"
2222
className="btn"
2323
inline
@@ -31,13 +31,13 @@
3131
<ant-button
3232
type="primary"
3333
icon="SearchOutline"
34-
bind:tap="handleTap"
34+
bindtap="handleTap"
3535
inline
3636
className="round"
3737
>主要按钮</ant-button>
3838
<ant-button
3939
type="primary"
40-
bind:tap="handleTap"
40+
bindtap="handleTap"
4141
inline
4242
danger
4343
className="round"
@@ -50,24 +50,24 @@
5050
<ant-button
5151
type="primary"
5252
icon="SearchOutline"
53-
bind:tap="handleTap"
53+
bindtap="handleTap"
5454
inline
5555
className="circle"
5656
></ant-button>
5757
<ant-button
5858
icon="SearchOutline"
59-
bind:tap="handleTap"
59+
bindtap="handleTap"
6060
inline
6161
className="circle"
6262
></ant-button>
6363
<ant-button
6464
type="primary"
65-
bind:tap="handleTap"
65+
bindtap="handleTap"
6666
inline
6767
className="circle"
6868
>A</ant-button>
6969
<ant-button
70-
bind:tap="handleTap"
70+
bindtap="handleTap"
7171
inline
7272
className="circle"
7373
>A</ant-button>

compiled/wechat/demo/pages/ButtonIcon/index.wxml

+6-6
Original file line numberDiff line numberDiff line change
@@ -74,45 +74,45 @@
7474
<ant-button
7575
type="primary"
7676
icon="SmileOutline"
77-
bind:tap="handleTap"
77+
bindtap="handleTap"
7878
inline
7979
loading
8080
>loading</ant-button>
8181
<ant-button
8282
type="primary"
8383
icon="ForbidFill"
84-
bind:tap="handleTap"
84+
bindtap="handleTap"
8585
inline
8686
danger
8787
loading
8888
>loading</ant-button>
8989
<ant-button
9090
type="primary"
9191
icon="SmileOutline"
92-
bind:tap="handleTap"
92+
bindtap="handleTap"
9393
loading
9494
>loading</ant-button>
9595
</ant-container>
9696
<ant-container title="disabled icon">
9797
<ant-button
9898
type="primary"
9999
icon="SmileOutline"
100-
bind:tap="handleTap"
100+
bindtap="handleTap"
101101
inline
102102
disabled
103103
>disabled</ant-button>
104104
<ant-button
105105
type="primary"
106106
icon="ForbidFill"
107-
bind:tap="handleTap"
107+
bindtap="handleTap"
108108
inline
109109
danger
110110
disabled
111111
>disabled</ant-button>
112112
<ant-button
113113
type="primary"
114114
icon="SmileOutline"
115-
bind:tap="handleTap"
115+
bindtap="handleTap"
116116
disabled
117117
>disabled</ant-button>
118118
</ant-container>

compiled/wechat/demo/pages/ButtonInline/index.wxml

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
<ant-button
66
type="primary"
77
inline
8-
bind:tap="handleTap"
8+
bindtap="handleTap"
99
>主要按钮</ant-button>
1010
<ant-button
1111
type="default"
1212
inline
13-
bind:tap="handleTap"
13+
bindtap="handleTap"
1414
>次要按钮</ant-button>
1515
<ant-button
1616
type="text"
1717
inline
18-
bind:tap="handleTap"
18+
bindtap="handleTap"
1919
>文本按钮</ant-button>
2020
</ant-container>
2121
<ant-container
@@ -26,19 +26,19 @@
2626
type="primary"
2727
inline
2828
size="large"
29-
bind:tap="handleTap"
29+
bindtap="handleTap"
3030
>主要按钮</ant-button>
3131
<ant-button
3232
type="primary"
3333
inline
3434
size="medium"
35-
bind:tap="handleTap"
35+
bindtap="handleTap"
3636
>主要按钮</ant-button>
3737
<ant-button
3838
type="primary"
3939
inline
4040
size="small"
41-
bind:tap="handleTap"
41+
bindtap="handleTap"
4242
>主要按钮</ant-button>
4343
</ant-container>
4444
<ant-container
@@ -49,19 +49,19 @@
4949
type="primary"
5050
inline
5151
danger
52-
bind:tap="handleTap"
52+
bindtap="handleTap"
5353
>主要按钮</ant-button>
5454
<ant-button
5555
type="default"
5656
inline
5757
danger
58-
bind:tap="handleTap"
58+
bindtap="handleTap"
5959
>次要按钮</ant-button>
6060
<ant-button
6161
type="text"
6262
inline
6363
danger
64-
bind:tap="handleTap"
64+
bindtap="handleTap"
6565
>文本按钮</ant-button>
6666
</ant-container>
6767
<ant-container

compiled/wechat/demo/pages/Calendar/collapse-container/collapse-container.wxml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<ant-container title="{{containerTitle}}">
22
<view
33
slot="headerRight"
4-
bind:tap="handleToggle"
4+
bindtap="handleToggle"
55
data-id="demo1"
66
>
77
<!--display: inline-->
@@ -14,7 +14,7 @@
1414
</view>
1515
<view
1616
wx:else
17-
bind:tap="handleToggle"
17+
bindtap="handleToggle"
1818
>
1919
<slot name="description"></slot>
2020
<view class="placeholder">展示</view>

compiled/wechat/demo/pages/Calendar/index.wxml

+7-7
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
<view slot="content">
3232
<view class="custom-header">
3333
<view
34-
bind:tap="demo3PreviousMonth"
34+
bindtap="demo3PreviousMonth"
3535
class="custom-header-left"
3636
>
3737
<ant-icon type="LeftOutline"></ant-icon>上个月</view>
3838
<view>{{demo3.title}}</view>
3939
<view
40-
bind:tap="demo3NextMonth"
40+
bindtap="demo3NextMonth"
4141
class="custom-header-right"
4242
>下个月<ant-icon type="RightOutline"></ant-icon>
4343
</view>
@@ -102,25 +102,25 @@
102102
style="height: 1000rpx"
103103
>
104104
<ant-calendar
105-
bind:ref="handleRef"
105+
bindref="handleRef"
106106
value="{{demo9.value}}"
107-
bind:change="demo9HandleChange"
107+
bindchange="demo9HandleChange"
108108
selectionMode="single"
109109
changedScrollIntoView
110110
></ant-calendar>
111111
<ant-button
112112
type="primary"
113-
bind:tap="demo9HandlePreviousDay"
113+
bindtap="demo9HandlePreviousDay"
114114
>上一天</ant-button>
115115
<ant-button
116116
style="margin-top: 8rpx"
117117
type="primary"
118-
bind:tap="demo9HandleNextDay"
118+
bindtap="demo9HandleNextDay"
119119
>下一天</ant-button>
120120
<ant-button
121121
style="margin-top: 8rpx"
122122
type="primary"
123-
bind:tap="demo9HandleScrollIntoView"
123+
bindtap="demo9HandleScrollIntoView"
124124
>滚动到指定日期</ant-button>
125125
</view>
126126
</collapse-container>

0 commit comments

Comments
 (0)