File tree Expand file tree Collapse file tree
products/tdesign-vue-next/packages/components/drawer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ onClose | Function | | Typescript:`(context: DrawerCloseContext) => void`<br/
3535onCloseBtnClick | Function | | Typescript:` (context: { e: MouseEvent }) => void ` <br /> | N
3636onConfirm | Function | | Typescript:` (context: { e: MouseEvent }) => void ` <br /> | N
3737onEscKeydown | Function | | Typescript:` (context: { e: KeyboardEvent }) => void ` <br /> | N
38+ onOpen | Function | | Typescript:` () => void ` <br /> | N
3839onOverlayClick | Function | | Typescript:` (context: { e: MouseEvent }) => void ` <br /> | N
3940onSizeDragEnd | 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
4950close-btn-click | ` (context: { e: MouseEvent }) ` | \-
5051confirm | ` (context: { e: MouseEvent }) ` | \-
5152esc-keydown | ` (context: { e: KeyboardEvent }) ` | \-
53+ open | \- | \-
5254overlay-click | ` (context: { e: MouseEvent }) ` | \-
5355size-drag-end | ` (context: { e: MouseEvent; size: number }) ` | trigger on size drag end
5456
@@ -78,3 +80,5 @@ name | params | default | description
7880-- | -- | -- | --
7981options | \- | - | Typescript:` DrawerOptions `
8082context | \- | - | Typescript:` AppContext ` 。[ see more ts definition] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
83+
84+ 插件返回值:` DrawerInstance `
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ onClose | Function | | TS 类型:`(context: DrawerCloseContext) => void`<br/>
7171onCloseBtnClick | Function | | TS 类型:` (context: { e: MouseEvent }) => void ` <br />如果关闭按钮存在,点击关闭按钮时触发该事件,同时触发关闭事件 | N
7272onConfirm | Function | | TS 类型:` (context: { e: MouseEvent }) => void ` <br />如果“确认”按钮存在,则点击“确认”按钮时触发 | N
7373onEscKeydown | Function | | TS 类型:` (context: { e: KeyboardEvent }) => void ` <br />按下 ESC 键时触发 | N
74+ onOpen | Function | | TS 类型:` () => void ` <br />抽屉打开时触发 | N
7475onOverlayClick | Function | | TS 类型:` (context: { e: MouseEvent }) => void ` <br />如果蒙层存在,点击蒙层时触发 | N
7576onSizeDragEnd | Function | | TS 类型:` (context: { e: MouseEvent; size: number }) => void ` <br />抽屉大小拖拽结束时触发,事件参数 ` size ` 在横向抽屉中表示宽度,在纵向抽屉中表示高度 | N
7677
@@ -85,6 +86,7 @@ close | `(context: DrawerCloseContext)` | 关闭事件,取消按钮点击时
8586close-btn-click | ` (context: { e: MouseEvent }) ` | 如果关闭按钮存在,点击关闭按钮时触发该事件,同时触发关闭事件
8687confirm | ` (context: { e: MouseEvent }) ` | 如果“确认”按钮存在,则点击“确认”按钮时触发
8788esc-keydown | ` (context: { e: KeyboardEvent }) ` | 按下 ESC 键时触发
89+ open | \- | 抽屉打开时触发
8890overlay-click | ` (context: { e: MouseEvent }) ` | 如果蒙层存在,点击蒙层时触发
8991size-drag-end | ` (context: { e: MouseEvent; size: number }) ` | 抽屉大小拖拽结束时触发,事件参数 ` size ` 在横向抽屉中表示宽度,在纵向抽屉中表示高度
9092
@@ -114,3 +116,5 @@ update | `(props: DrawerOptions)` | \- | 更新抽屉内容
114116-- | -- | -- | --
115117options | \- | - | TS 类型:` DrawerOptions `
116118context | \- | - | TS 类型:` AppContext ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
119+
120+ 插件返回值:` DrawerInstance `
Original file line number Diff line number Diff 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` 在横向抽屉中表示宽度,在纵向抽屉中表示高度 */
Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff line change 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": [
You can’t perform that action at this time.
0 commit comments