Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ opened | Boolean / Array | false | Typescript:`boolean \| Array<boolean>` | N
right | TNode | - | Typescript:`Array<SwipeActionItem> \| TNode` `interface SwipeActionItem {text: string; className?: string; style?: Styles; sure?: Sure; onClick?: () => void; [key: string]: any }` `type Sure = string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/swipe-cell/type.ts) | N
onChange | Function | | Typescript:`(value: string) => void`<br/> | N
onClick | Function | | Typescript:`(action: SwipeActionItem, source: SwipeSource) => void`<br/>[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/swipe-cell/type.ts)。<br/>`type SwipeSource = 'left' \| 'right'`<br/> | N
onDragend | Function | | Typescript:`() => void`<br/> | N
onDragstart | Function | | Typescript:`() => void`<br/> | N
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ opened | Boolean / Array | false | 操作项是否呈现为打开态,值为数
right | TNode | - | 右侧滑动操作项。有两种定义方式,一种是使用数组,二种是使用插槽。`right.text` 表示操作文本,`right.className` 表示操作项类名,`right.style` 表示操作项样式,`right.onClick` 表示点击操作项后执行的回调函数。示例:`[{ text: '删除', style: 'background-color: red', onClick: () => {} }]`。TS 类型:`Array<SwipeActionItem> \| TNode` `interface SwipeActionItem {text: string; className?: string; style?: Styles; sure?: Sure; onClick?: () => void; [key: string]: any }` `type Sure = string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/swipe-cell/type.ts) | N
onChange | Function | | TS 类型:`(value: string) => void`<br/>菜单展开或者收回后将菜单的状态传递给父组件,值为数组时表示分别控制左右滑动的展开和收起状态 | N
onClick | Function | | TS 类型:`(action: SwipeActionItem, source: SwipeSource) => void`<br/>操作项点击时触发(插槽写法组件不触发,业务侧自定义内容和事件)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/swipe-cell/type.ts)。<br/>`type SwipeSource = 'left' \| 'right'`<br/> | N
onDragend | Function | | TS 类型:`() => void`<br/>滑动结束事件 | N
onDragstart | Function | | TS 类型:`() => void`<br/>滑动开始事件 | N
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ export interface TdSwipeCellProps {
* 操作项点击时触发(插槽写法组件不触发,业务侧自定义内容和事件)
*/
onClick?: (action: SwipeActionItem, source: SwipeSource) => void;
/**
* 滑动结束事件
*/
onDragend?: () => void;
/**
* 滑动开始事件
*/
onDragstart?: () => void;
}

export interface SwipeActionItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@ export default {
onChange: Function as PropType<TdSwipeCellProps['onChange']>,
/** 操作项点击时触发(插槽写法组件不触发,业务侧自定义内容和事件) */
onClick: Function as PropType<TdSwipeCellProps['onClick']>,
/** 滑动结束事件 */
onDragend: Function as PropType<TdSwipeCellProps['onDragend']>,
/** 滑动开始事件 */
onDragstart: Function as PropType<TdSwipeCellProps['onDragstart']>,
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@ default | String / Slot / Function | - | Typescript:`string \| TNode`。[see m
disabled | Boolean | - | \- | N
left | Array / Slot / Function | - | Typescript:`Array<SwipeActionItem> \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
opened | Boolean / Array | false | Typescript:`boolean \| Array<boolean>` | N
right | Array / Slot / Function | - | Typescript:`Array<SwipeActionItem> \| TNode` `interface SwipeActionItem {text: string; className?: string; style?: string; sure?: string \| TNode; onClick?: () => void; [key: string]: any }`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swipe-cell/type.ts) | N
right | Array / Slot / Function | - | Typescript:`Array<SwipeActionItem> \| TNode` `interface SwipeActionItem {text: string; className?: string; style?: Styles; sure?: Sure; onClick?: () => void; [key: string]: any }` `type Sure = string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swipe-cell/type.ts) | N
onChange | Function | | Typescript:`(value: string) => void`<br/> | N
onClick | Function | | Typescript:`(action: SwipeActionItem, source: SwipeSource) => void`<br/>[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swipe-cell/type.ts)。<br/>`type SwipeSource = 'left' \| 'right'`<br/> | N
onDragend | Function | | Typescript:`() => void`<br/> | N
onDragstart | Function | | Typescript:`() => void`<br/> | N

### SwipeCell Events

name | params | description
-- | -- | --
change | `(value: string)` | \-
click | `(action: SwipeActionItem, source: SwipeSource)` | [see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swipe-cell/type.ts)。<br/>`type SwipeSource = 'left' \| 'right'`<br/>
dragend | \- | \-
dragstart | \- | \-

### SwipeCellInstanceFunctions 组件实例方法

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@ default | String / Slot / Function | - | 操作项以外的内容,同 content
disabled | Boolean | - | 是否禁用滑动 | N
left | Array / Slot / Function | - | 左侧滑动操作项。所有行为同 `right`。TS 类型:`Array<SwipeActionItem> \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
opened | Boolean / Array | false | 操作项是否呈现为打开态,值为数组时表示分别控制左右滑动的展开和收起状态。TS 类型:`boolean \| Array<boolean>` | N
right | Array / Slot / Function | - | 右侧滑动操作项。有两种定义方式,一种是使用数组,二种是使用插槽。`right.text` 表示操作文本,`right.className` 表示操作项类名,`right.style` 表示操作项样式,`right.onClick` 表示点击操作项后执行的回调函数。示例:`[{ text: '删除', style: 'background-color: red', onClick: () => {} }]`。TS 类型:`Array<SwipeActionItem> \| TNode` `interface SwipeActionItem {text: string; className?: string; style?: string; sure?: string \| TNode; onClick?: () => void; [key: string]: any }`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swipe-cell/type.ts) | N
right | Array / Slot / Function | - | 右侧滑动操作项。有两种定义方式,一种是使用数组,二种是使用插槽。`right.text` 表示操作文本,`right.className` 表示操作项类名,`right.style` 表示操作项样式,`right.onClick` 表示点击操作项后执行的回调函数。示例:`[{ text: '删除', style: 'background-color: red', onClick: () => {} }]`。TS 类型:`Array<SwipeActionItem> \| TNode` `interface SwipeActionItem {text: string; className?: string; style?: Styles; sure?: Sure; onClick?: () => void; [key: string]: any }` `type Sure = string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swipe-cell/type.ts) | N
onChange | Function | | TS 类型:`(value: string) => void`<br/>菜单展开或者收回后将菜单的状态传递给父组件,值为数组时表示分别控制左右滑动的展开和收起状态 | N
onClick | Function | | TS 类型:`(action: SwipeActionItem, source: SwipeSource) => void`<br/>操作项点击时触发(插槽写法组件不触发,业务侧自定义内容和事件)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swipe-cell/type.ts)。<br/>`type SwipeSource = 'left' \| 'right'`<br/> | N
onDragend | Function | | TS 类型:`() => void`<br/>滑动结束事件 | N
onDragstart | Function | | TS 类型:`() => void`<br/>滑动开始事件 | N

### SwipeCell Events

名称 | 参数 | 描述
-- | -- | --
change | `(value: string)` | 菜单展开或者收回后将菜单的状态传递给父组件,值为数组时表示分别控制左右滑动的展开和收起状态
click | `(action: SwipeActionItem, source: SwipeSource)` | 操作项点击时触发(插槽写法组件不触发,业务侧自定义内容和事件)。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swipe-cell/type.ts)。<br/>`type SwipeSource = 'left' \| 'right'`<br/>
dragend | \- | 滑动结束事件
dragstart | \- | 滑动开始事件

### SwipeCellInstanceFunctions 组件实例方法

Expand Down
16 changes: 13 additions & 3 deletions packages/products/tdesign-mobile-vue/src/swipe-cell/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { TNode } from '../common';
import { TNode, Styles } from '../common';

export interface TdSwipeCellProps {
/**
Expand Down Expand Up @@ -40,6 +40,14 @@ export interface TdSwipeCellProps {
* 操作项点击时触发(插槽写法组件不触发,业务侧自定义内容和事件)
*/
onClick?: (action: SwipeActionItem, source: SwipeSource) => void;
/**
* 滑动结束事件
*/
onDragend?: () => void;
/**
* 滑动开始事件
*/
onDragstart?: () => void;
}

/** 组件实例方法 */
Expand All @@ -53,10 +61,12 @@ export interface SwipeCellInstanceFunctions {
export interface SwipeActionItem {
text: string;
className?: string;
style?: string;
sure?: string | TNode;
style?: Styles;
sure?: Sure;
onClick?: () => void;
[key: string]: any;
}

export type Sure = string | TNode;

export type SwipeSource = 'left' | 'right';
8 changes: 8 additions & 0 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -114442,6 +114442,8 @@
{
"id": 1719280157,
"platform_framework": [
"8",
"16",
"64"
],
"component": "SwipeCell",
Expand All @@ -114468,13 +114470,17 @@
"support_default_value": 0,
"field_category_text": "Events",
"platform_framework_text": [
"Vue(Mobile)",
"React(Mobile)",
"Miniprogram"
],
"field_type_text": []
},
{
"id": 1719280112,
"platform_framework": [
"8",
"16",
"64"
],
"component": "SwipeCell",
Expand All @@ -114501,6 +114507,8 @@
"support_default_value": 0,
"field_category_text": "Events",
"platform_framework_text": [
"Vue(Mobile)",
"React(Mobile)",
"Miniprogram"
],
"field_type_text": []
Expand Down