Skip to content

Commit

Permalink
feat: 为 Tabs 添加 catchTouchStart/catchTouchMove 属性 (#1350)
Browse files Browse the repository at this point in the history
* feat: 为 Tabs 添加 catchTouchStart/catchTouchMove 属性

* feat: 为 Tabs 添加 catchTouchStart/catchTouchMove 属性

---------

Co-authored-by: 柏丘 <[email protected]>
  • Loading branch information
charleylla and 柏丘 authored Dec 25, 2024
1 parent 8b66127 commit 7355df0
Show file tree
Hide file tree
Showing 121 changed files with 471 additions and 435 deletions.
4 changes: 4 additions & 0 deletions compiled/alipay/src/Tabs/index.axml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
scrollX="{{true}}"
scrollWithAnimation="{{true}}"
scrollAnimationDuration="{{300}}"
catchTouchStart="{{catchTouchStart}}"
catchTouchMove="{{catchTouchMove}}"
>
<view></view>
<block
Expand Down Expand Up @@ -117,6 +119,8 @@
scrollY="{{true}}"
scrollWithAnimation="{{true}}"
scrollAnimationDuration="{{300}}"
catchTouchStart="{{catchTouchStart}}"
catchTouchMove="{{catchTouchMove}}"
>
<view class="ant-vtabs-bar-item-wrap">
<block
Expand Down
12 changes: 12 additions & 0 deletions compiled/alipay/src/Tabs/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ export interface ITabsProps extends IBaseProps {
*@description tab active类名
*/
tabActiveClassName?: string;

/**
* swiper 嵌套场景下,是否组织 Tab 的 touch 事件冒泡:https://opendocs.alipay.com/mini/component/scroll-view
* @description catchTouchStart
*/
catchTouchStart?: boolean;

/**
* swiper 嵌套场景下,是否组织 Tab 的 touch 事件冒泡:https://opendocs.alipay.com/mini/component/scroll-view
* @description catchTouchMove
*/
catchTouchMove?: boolean;
}

export const TabsDefaultProps: Partial<ITabsProps> = {
Expand Down
6 changes: 3 additions & 3 deletions compiled/wechat/demo/pages/ActionSheet/index.wxml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<ant-container title="基础用法">
<ant-button
bind:tap="handleOpenBasic"
bindtap="handleOpenBasic"
inline="{{true}}"
size="large"
data-index="1"
>基础用法</ant-button>
</ant-container>
<ant-container title="选项状态">
<ant-button
bind:tap="handleOpenBasic"
bindtap="handleOpenBasic"
inline="{{true}}"
size="large"
data-index="2"
>危险状态&禁用状态</ant-button>
</ant-container>
<ant-container title="带注释及icon">
<ant-button
bind:tap="handleOpenBasic"
bindtap="handleOpenBasic"
inline="{{true}}"
size="large"
data-index="3"
Expand Down
18 changes: 9 additions & 9 deletions compiled/wechat/demo/pages/Button/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
>
<ant-button
type="primary"
bind:tap="handleTap"
bindtap="handleTap"
>主要按钮</ant-button>
<ant-button
type="default"
bind:tap="handleTap"
bindtap="handleTap"
>次要按钮</ant-button>
<ant-button
type="text"
bind:tap="handleTap"
bindtap="handleTap"
>文本按钮</ant-button>
</ant-container>
<ant-container
Expand All @@ -22,17 +22,17 @@
<ant-button
type="primary"
subText="副标题"
bind:tap="handleTap"
bindtap="handleTap"
>主要按钮</ant-button>
<ant-button
type="default"
subText="副标题"
bind:tap="handleTap"
bindtap="handleTap"
>次要按钮</ant-button>
<ant-button
type="text"
subText="副标题"
bind:tap="handleTap"
bindtap="handleTap"
>文本按钮</ant-button>
</ant-container>
<ant-container
Expand Down Expand Up @@ -76,16 +76,16 @@
<ant-button
type="primary"
danger
bind:tap="handleTap"
bindtap="handleTap"
>主要按钮</ant-button>
<ant-button
type="default"
danger
bind:tap="handleTap"
bindtap="handleTap"
>次要按钮</ant-button>
<ant-button
type="text"
danger
bind:tap="handleTap"
bindtap="handleTap"
>文本按钮</ant-button>
</ant-container>
18 changes: 9 additions & 9 deletions compiled/wechat/demo/pages/ButtonCustom/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
<ant-button
type="primary"
icon="SmileOutline"
bind:tap="handleTap"
bindtap="handleTap"
className="btn"
>主要按钮</ant-button>
<ant-button
type="primary"
bind:tap="handleTap"
bindtap="handleTap"
icon="SmileOutline"
className="btn"
inline
>主要按钮</ant-button>
<ant-button
type="primary"
bind:tap="handleTap"
bindtap="handleTap"
icon="ForbidFill"
className="btn"
inline
Expand All @@ -31,13 +31,13 @@
<ant-button
type="primary"
icon="SearchOutline"
bind:tap="handleTap"
bindtap="handleTap"
inline
className="round"
>主要按钮</ant-button>
<ant-button
type="primary"
bind:tap="handleTap"
bindtap="handleTap"
inline
danger
className="round"
Expand All @@ -50,24 +50,24 @@
<ant-button
type="primary"
icon="SearchOutline"
bind:tap="handleTap"
bindtap="handleTap"
inline
className="circle"
></ant-button>
<ant-button
icon="SearchOutline"
bind:tap="handleTap"
bindtap="handleTap"
inline
className="circle"
></ant-button>
<ant-button
type="primary"
bind:tap="handleTap"
bindtap="handleTap"
inline
className="circle"
>A</ant-button>
<ant-button
bind:tap="handleTap"
bindtap="handleTap"
inline
className="circle"
>A</ant-button>
Expand Down
12 changes: 6 additions & 6 deletions compiled/wechat/demo/pages/ButtonIcon/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -74,45 +74,45 @@
<ant-button
type="primary"
icon="SmileOutline"
bind:tap="handleTap"
bindtap="handleTap"
inline
loading
>loading</ant-button>
<ant-button
type="primary"
icon="ForbidFill"
bind:tap="handleTap"
bindtap="handleTap"
inline
danger
loading
>loading</ant-button>
<ant-button
type="primary"
icon="SmileOutline"
bind:tap="handleTap"
bindtap="handleTap"
loading
>loading</ant-button>
</ant-container>
<ant-container title="disabled icon">
<ant-button
type="primary"
icon="SmileOutline"
bind:tap="handleTap"
bindtap="handleTap"
inline
disabled
>disabled</ant-button>
<ant-button
type="primary"
icon="ForbidFill"
bind:tap="handleTap"
bindtap="handleTap"
inline
danger
disabled
>disabled</ant-button>
<ant-button
type="primary"
icon="SmileOutline"
bind:tap="handleTap"
bindtap="handleTap"
disabled
>disabled</ant-button>
</ant-container>
18 changes: 9 additions & 9 deletions compiled/wechat/demo/pages/ButtonInline/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
<ant-button
type="primary"
inline
bind:tap="handleTap"
bindtap="handleTap"
>主要按钮</ant-button>
<ant-button
type="default"
inline
bind:tap="handleTap"
bindtap="handleTap"
>次要按钮</ant-button>
<ant-button
type="text"
inline
bind:tap="handleTap"
bindtap="handleTap"
>文本按钮</ant-button>
</ant-container>
<ant-container
Expand All @@ -26,19 +26,19 @@
type="primary"
inline
size="large"
bind:tap="handleTap"
bindtap="handleTap"
>主要按钮</ant-button>
<ant-button
type="primary"
inline
size="medium"
bind:tap="handleTap"
bindtap="handleTap"
>主要按钮</ant-button>
<ant-button
type="primary"
inline
size="small"
bind:tap="handleTap"
bindtap="handleTap"
>主要按钮</ant-button>
</ant-container>
<ant-container
Expand All @@ -49,19 +49,19 @@
type="primary"
inline
danger
bind:tap="handleTap"
bindtap="handleTap"
>主要按钮</ant-button>
<ant-button
type="default"
inline
danger
bind:tap="handleTap"
bindtap="handleTap"
>次要按钮</ant-button>
<ant-button
type="text"
inline
danger
bind:tap="handleTap"
bindtap="handleTap"
>文本按钮</ant-button>
</ant-container>
<ant-container
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ant-container title="{{containerTitle}}">
<view
slot="headerRight"
bind:tap="handleToggle"
bindtap="handleToggle"
data-id="demo1"
>
<!--display: inline-->
Expand All @@ -14,7 +14,7 @@
</view>
<view
wx:else
bind:tap="handleToggle"
bindtap="handleToggle"
>
<slot name="description"></slot>
<view class="placeholder">展示</view>
Expand Down
14 changes: 7 additions & 7 deletions compiled/wechat/demo/pages/Calendar/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
<view slot="content">
<view class="custom-header">
<view
bind:tap="demo3PreviousMonth"
bindtap="demo3PreviousMonth"
class="custom-header-left"
>
<ant-icon type="LeftOutline"></ant-icon>上个月</view>
<view>{{demo3.title}}</view>
<view
bind:tap="demo3NextMonth"
bindtap="demo3NextMonth"
class="custom-header-right"
>下个月<ant-icon type="RightOutline"></ant-icon>
</view>
Expand Down Expand Up @@ -102,25 +102,25 @@
style="height: 1000rpx"
>
<ant-calendar
bind:ref="handleRef"
bindref="handleRef"
value="{{demo9.value}}"
bind:change="demo9HandleChange"
bindchange="demo9HandleChange"
selectionMode="single"
changedScrollIntoView
></ant-calendar>
<ant-button
type="primary"
bind:tap="demo9HandlePreviousDay"
bindtap="demo9HandlePreviousDay"
>上一天</ant-button>
<ant-button
style="margin-top: 8rpx"
type="primary"
bind:tap="demo9HandleNextDay"
bindtap="demo9HandleNextDay"
>下一天</ant-button>
<ant-button
style="margin-top: 8rpx"
type="primary"
bind:tap="demo9HandleScrollIntoView"
bindtap="demo9HandleScrollIntoView"
>滚动到指定日期</ant-button>
</view>
</collapse-container>
Loading

0 comments on commit 7355df0

Please sign in to comment.