Skip to content

Commit e72860f

Browse files
committed
feat: open
1 parent 5241443 commit e72860f

6 files changed

Lines changed: 52 additions & 1 deletion

File tree

db/TDesign.db

0 Bytes
Binary file not shown.

packages/products/tdesign-vue-next/packages/components/drawer/drawer.en-US.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ onClose | Function | | Typescript:`(context: DrawerCloseContext) => void`<br/
3535
onCloseBtnClick | Function | | Typescript:`(context: { e: MouseEvent }) => void`<br/> | N
3636
onConfirm | Function | | Typescript:`(context: { e: MouseEvent }) => void`<br/> | N
3737
onEscKeydown | Function | | Typescript:`(context: { e: KeyboardEvent }) => void`<br/> | N
38+
onOpen | Function | | Typescript:`() => void`<br/> | N
3839
onOverlayClick | Function | | Typescript:`(context: { e: MouseEvent }) => void`<br/> | N
3940
onSizeDragEnd | Function | | Typescript:`(context: { e: MouseEvent; size: number }) => void`<br/>trigger on size drag end | N
4041

@@ -49,6 +50,7 @@ close | `(context: DrawerCloseContext)` | [see more ts definition](https://githu
4950
close-btn-click | `(context: { e: MouseEvent })` | \-
5051
confirm | `(context: { e: MouseEvent })` | \-
5152
esc-keydown | `(context: { e: KeyboardEvent })` | \-
53+
open | \- | \-
5254
overlay-click | `(context: { e: MouseEvent })` | \-
5355
size-drag-end | `(context: { e: MouseEvent; size: number })` | trigger on size drag end
5456

@@ -78,3 +80,5 @@ name | params | default | description
7880
-- | -- | -- | --
7981
options | \- | - | Typescript:`DrawerOptions`
8082
context | \- | - | Typescript:`AppContext`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts)
83+
84+
插件返回值:`DrawerInstance`

packages/products/tdesign-vue-next/packages/components/drawer/drawer.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ onClose | Function | | TS 类型:`(context: DrawerCloseContext) => void`<br/>
7171
onCloseBtnClick | Function | | TS 类型:`(context: { e: MouseEvent }) => void`<br/>如果关闭按钮存在,点击关闭按钮时触发该事件,同时触发关闭事件 | N
7272
onConfirm | Function | | TS 类型:`(context: { e: MouseEvent }) => void`<br/>如果“确认”按钮存在,则点击“确认”按钮时触发 | N
7373
onEscKeydown | Function | | TS 类型:`(context: { e: KeyboardEvent }) => void`<br/>按下 ESC 键时触发 | N
74+
onOpen | Function | | TS 类型:`() => void`<br/>抽屉打开时触发 | N
7475
onOverlayClick | Function | | TS 类型:`(context: { e: MouseEvent }) => void`<br/>如果蒙层存在,点击蒙层时触发 | N
7576
onSizeDragEnd | Function | | TS 类型:`(context: { e: MouseEvent; size: number }) => void`<br/>抽屉大小拖拽结束时触发,事件参数 `size` 在横向抽屉中表示宽度,在纵向抽屉中表示高度 | N
7677

@@ -85,6 +86,7 @@ close | `(context: DrawerCloseContext)` | 关闭事件,取消按钮点击时
8586
close-btn-click | `(context: { e: MouseEvent })` | 如果关闭按钮存在,点击关闭按钮时触发该事件,同时触发关闭事件
8687
confirm | `(context: { e: MouseEvent })` | 如果“确认”按钮存在,则点击“确认”按钮时触发
8788
esc-keydown | `(context: { e: KeyboardEvent })` | 按下 ESC 键时触发
89+
open | \- | 抽屉打开时触发
8890
overlay-click | `(context: { e: MouseEvent })` | 如果蒙层存在,点击蒙层时触发
8991
size-drag-end | `(context: { e: MouseEvent; size: number })` | 抽屉大小拖拽结束时触发,事件参数 `size` 在横向抽屉中表示宽度,在纵向抽屉中表示高度
9092

@@ -114,3 +116,5 @@ update | `(props: DrawerOptions)` | \- | 更新抽屉内容
114116
-- | -- | -- | --
115117
options | \- | - | TS 类型:`DrawerOptions`
116118
context | \- | - | TS 类型:`AppContext`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts)
119+
120+
插件返回值:`DrawerInstance`

packages/products/tdesign-vue-next/packages/components/drawer/props.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ export default {
121121
onConfirm: Function as PropType<TdDrawerProps['onConfirm']>,
122122
/** 按下 ESC 键时触发 */
123123
onEscKeydown: Function as PropType<TdDrawerProps['onEscKeydown']>,
124+
/** 抽屉打开时触发 */
125+
onOpen: Function as PropType<TdDrawerProps['onOpen']>,
124126
/** 如果蒙层存在,点击蒙层时触发 */
125127
onOverlayClick: Function as PropType<TdDrawerProps['onOverlayClick']>,
126128
/** 抽屉大小拖拽结束时触发,事件参数 `size` 在横向抽屉中表示宽度,在纵向抽屉中表示高度 */

packages/products/tdesign-vue-next/packages/components/drawer/type.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ export interface TdDrawerProps {
136136
* 按下 ESC 键时触发
137137
*/
138138
onEscKeydown?: (context: { e: KeyboardEvent }) => void;
139+
/**
140+
* 抽屉打开时触发
141+
*/
142+
onOpen?: () => void;
139143
/**
140144
* 如果蒙层存在,点击蒙层时触发
141145
*/
@@ -196,4 +200,4 @@ export interface DrawerCloseContext {
196200
e: MouseEvent | KeyboardEvent;
197201
}
198202

199-
export type DrawerMethod = (options?: DrawerOptions, context?: AppContext) => void;
203+
export type DrawerMethod = (options?: DrawerOptions, context?: AppContext) => DrawerInstance;

packages/scripts/api.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49225,6 +49225,43 @@
4922549225
"Array"
4922649226
]
4922749227
},
49228+
{
49229+
"id": 1754230138,
49230+
"platform_framework": [
49231+
"1",
49232+
"2",
49233+
"4"
49234+
],
49235+
"component": "Drawer",
49236+
"field_category": 2,
49237+
"field_name": "open",
49238+
"field_type": [],
49239+
"field_default_value": "",
49240+
"field_enum": "",
49241+
"field_desc_zh": "抽屉打开时触发",
49242+
"field_desc_en": null,
49243+
"field_required": 0,
49244+
"event_input": "",
49245+
"create_time": "2025-08-03 14:08:58",
49246+
"update_time": "2025-08-03 14:08:58",
49247+
"event_output": null,
49248+
"custom_field_type": null,
49249+
"syntactic_sugar": null,
49250+
"readonly": 1,
49251+
"html_attribute": 0,
49252+
"trigger_elements": "",
49253+
"deprecated": 0,
49254+
"version": "",
49255+
"test_description": null,
49256+
"support_default_value": 0,
49257+
"field_category_text": "Events",
49258+
"platform_framework_text": [
49259+
"Vue(PC)",
49260+
"React(PC)",
49261+
"Angular(PC)"
49262+
],
49263+
"field_type_text": []
49264+
},
4922849265
{
4922949266
"id": 703,
4923049267
"platform_framework": [

0 commit comments

Comments
 (0)