3131{{ plugin }}
3232
3333## API
34+
3435### Message Props
3536
36- 名称 | 类型 | 默认值 | 说明 | 必传
37+ 名称 | 类型 | 默认值 | 描述 | 必传
3738-- | -- | -- | -- | --
3839closeBtn | String / Boolean / Slot / Function | undefined | 关闭按钮,可以自定义。值为 true 显示默认关闭按钮,值为 false 不显示关闭按钮。值类型为 string 则直接显示值,如:“关闭”。也可以完全自定义按钮。TS 类型:` string \| boolean \| TNode ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts ) | N
3940content | String / Slot / Function | - | 用于自定义消息弹出内容。TS 类型:` string \| TNode ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts ) | N
40- duration | Number | 3000 | 消息内置计时器,计时到达时会触发 duration-end 事件。单位:毫秒。值为 0 则表示没有计时器。 | N
41+ duration | Number | 3000 | 消息内置计时器,计时到达时会触发 duration-end 事件。单位:毫秒。值为 0 则表示没有计时器 | N
4142icon | Boolean / Slot / Function | true | 用于自定义消息前面的图标,优先级大于 theme 设定的图标。值为 false 则不显示图标,值为 true 显示 theme 设定图标。TS 类型:` boolean \| TNode ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts ) | N
4243theme | String | info | 消息组件风格。可选项:info/success/warning/error/question/loading。TS 类型:` MessageThemeList ` ` type MessageThemeList = 'info' \| 'success' \| 'warning' \| 'error' \| 'question' \| 'loading' ` 。[ 详细类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/message/type.ts ) | N
4344onClose | Function | | TS 类型:` (context: { trigger: 'close-click' \| 'duration-end', e?: MouseEvent }) => void ` <br />关闭消息时触发 | N
@@ -54,109 +55,107 @@ duration-end | \- | 计时结束后触发
5455
5556### MessageOptions
5657
57- 名称 | 类型 | 默认值 | 说明 | 必传
58+ 名称 | 类型 | 默认值 | 描述 | 必传
5859-- | -- | -- | -- | --
5960attach | String / Function | 'body' | 指定弹框挂载的父节点。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body。TS 类型:` AttachNode ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts ) | N
6061className | String | - | 类名 | N
6162offset | Array | - | 相对于 placement 的偏移量,示例:[ -10, 20] 或 [ '10em', '8rem'] 。TS 类型:` Array<string \| number> ` | N
6263placement | String | top | 弹出消息位置。可选项:center/top/left/right/bottom/top-left/top-right/bottom-left/bottom-right。TS 类型:` MessagePlacementList ` ` type MessagePlacementList = 'center' \| 'top' \| 'left' \| 'right' \| 'bottom' \| 'top-left' \| 'top-right' \| 'bottom-left' \| 'bottom-right' ` 。[ 详细类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/message/type.ts ) | N
6364style | Object | - | 内敛样式。TS 类型:` CSSProperties ` | N
6465zIndex | Number | 5000 | 消息层级 | N
65- ` MessageProps ` | \- | - | 继承 ` MessageProps ` 中的全部 API | N
66+ ` MessageProps ` | \- | - | 继承 ` MessageProps ` 中的全部属性 | N
6667
6768### MessagePlugin
6869
6970同时也支持 ` this.$message ` 。
7071
71- 参数名称 | 参数类型 | 参数默认值 | 参数说明
72+ 参数名称 | 参数类型 | 参数默认值 | 参数描述
7273-- | -- | -- | --
7374theme | String | - | 必需。消息类型。TS 类型:` MessageThemeList `
74- message | String / Object | - | 必需。消息内容。TS 类型:` string \| MessageOptions`
75+ message | Object | - | 必需。消息内容。TS 类型:` TNode \| MessageOptions` 。 [ 通用类型定义 ] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
7576duration | Number | 3000 | 消息显示时长,单位:毫秒。值为 0 表示永久显示
76- context | \- | - | 要继承的应用的上下文。TS 类型:` AppContext ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
77+ context | \- | - | 要继承的应用的上下文。。 TS 类型:` AppContext ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
7778
7879### MessagePlugin.info
7980
8081同时也支持 ` this.$message.info ` 。
8182
82- 参数名称 | 参数类型 | 参数默认值 | 参数说明
83+ 参数名称 | 参数类型 | 参数默认值 | 参数描述
8384-- | -- | -- | --
84- message | String / Object | - | 必需。消息内容。TS 类型:` string \| MessageInfoOptions` ` type MessageInfoOptions = Omit<MessageOptions, 'theme'> ` 。[ 详细类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/message/type.ts )
85+ message | Object | - | 必需。消息内容。TS 类型:` TNode \| MessageInfoOptions` ` type MessageInfoOptions = Omit<MessageOptions, 'theme'> ` 。 [ 通用类型定义 ] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts ) 。[ 详细类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/message/type.ts )
8586duration | Number | 3000 | 消息显示时长,单位:毫秒。值为 0 表示永久显示
86- context | \- | - | 要继承的应用的上下文。TS 类型:` AppContext ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
87-
87+ context | \- | - | 要继承的应用的上下文。。TS 类型:` AppContext ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
8888
8989### MessagePlugin.error
9090
9191同时也支持 ` this.$message.error ` 。
9292
93- 参数名称 | 参数类型 | 参数默认值 | 参数说明
93+ 参数名称 | 参数类型 | 参数默认值 | 参数描述
9494-- | -- | -- | --
95- message | String / Object | - | 必需。消息内容。TS 类型:` string \| MessageInfoOptions`
95+ message | Object | - | 必需。消息内容。TS 类型:` TNode \| MessageInfoOptions` 。 [ 通用类型定义 ] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
9696duration | Number | 3000 | 消息显示时长,单位:毫秒。值为 0 表示永久显示
97- context | \- | - | 要继承的应用的上下文。TS 类型:` AppContext ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
97+ context | \- | - | 要继承的应用的上下文。。 TS 类型:` AppContext ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
9898
9999### MessagePlugin.warning
100100
101101同时也支持 ` this.$message.warning ` 。
102102
103- 参数名称 | 参数类型 | 参数默认值 | 参数说明
103+ 参数名称 | 参数类型 | 参数默认值 | 参数描述
104104-- | -- | -- | --
105- message | String / Object | - | 必需。消息内容。TS 类型:` string \| MessageInfoOptions`
105+ message | Object | - | 必需。消息内容。TS 类型:` TNode \| MessageInfoOptions` 。 [ 通用类型定义 ] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
106106duration | Number | 3000 | 消息显示时长,单位:毫秒。值为 0 表示永久显示
107- context | \- | - | 要继承的应用的上下文。TS 类型:` AppContext ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
107+ context | \- | - | 要继承的应用的上下文。。 TS 类型:` AppContext ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
108108
109109### MessagePlugin.success
110110
111111同时也支持 ` this.$message.success ` 。
112112
113- 参数名称 | 参数类型 | 参数默认值 | 参数说明
113+ 参数名称 | 参数类型 | 参数默认值 | 参数描述
114114-- | -- | -- | --
115- message | String / Object | - | 必需。消息内容。TS 类型:` string \| MessageInfoOptions`
115+ message | Object | - | 必需。消息内容。TS 类型:` TNode \| MessageInfoOptions` 。 [ 通用类型定义 ] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
116116duration | Number | 3000 | 消息显示时长,单位:毫秒。值为 0 表示永久显示
117- context | \- | - | 要继承的应用的上下文。TS 类型:` AppContext ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
117+ context | \- | - | 要继承的应用的上下文。。 TS 类型:` AppContext ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
118118
119119### MessagePlugin.loading
120120
121121同时也支持 ` this.$message.loading ` 。
122122
123- 参数名称 | 参数类型 | 参数默认值 | 参数说明
123+ 参数名称 | 参数类型 | 参数默认值 | 参数描述
124124-- | -- | -- | --
125- message | String / Object | - | 必需。消息提醒内容。TS 类型:` string \| MessageInfoOptions`
125+ message | Object | - | 必需。消息提醒内容。TS 类型:` TNode \| MessageInfoOptions` 。 [ 通用类型定义 ] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
126126duration | Number | 3000 | 消息显示时长,单位:毫秒。值为 0 表示永久显示
127- context | \- | - | 要继承的应用的上下文。TS 类型:` AppContext ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
127+ context | \- | - | 要继承的应用的上下文。。 TS 类型:` AppContext ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
128128
129129### MessagePlugin.question
130130
131131同时也支持 ` this.$message.question ` 。
132132
133- 参数名称 | 参数类型 | 参数默认值 | 参数说明
133+ 参数名称 | 参数类型 | 参数默认值 | 参数描述
134134-- | -- | -- | --
135- message | String / Object | - | 必需。消息内容。TS 类型:` string \| MessageInfoOptions`
135+ message | Object | - | 必需。消息内容。TS 类型:` TNode \| MessageInfoOptions` 。 [ 通用类型定义 ] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
136136duration | Number | 3000 | 消息显示时长,单位:毫秒。值为 0 表示永久显示
137- context | \- | - | 要继承的应用的上下文。TS 类型:` AppContext ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
138-
137+ context | \- | - | 要继承的应用的上下文。。TS 类型:` AppContext ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts )
139138
140139### MessagePlugin.close
141140
142141同时也支持 ` this.$message.close ` 。
143142
144- 参数名称 | 参数类型 | 参数默认值 | 参数说明
143+ 参数名称 | 参数类型 | 参数默认值 | 参数描述
145144-- | -- | -- | --
146145options | Object | - | 必需。该插件参数为 $Message.info() 等插件执行后的返回值。示例:` const msg = $Message.info({}); $Message.close(msg) ` 。TS 类型:` Promise<MessageInstance> `
147146
148147### MessagePlugin.closeAll
149148
150149同时也支持 ` this.$message.closeAll ` 。
151150
152- 参数名称 | 参数类型 | 参数默认值 | 参数说明
151+ 参数名称 | 参数类型 | 参数默认值 | 参数描述
153152-- | -- | -- | --
154153\- | \- | - | \-
155154
156155### MessagePlugin.config
157156
158157同时也支持 ` this.$message.config ` 。
159158
160- 参数名称 | 参数类型 | 参数默认值 | 参数说明
159+ 参数名称 | 参数类型 | 参数默认值 | 参数描述
161160-- | -- | -- | --
162161message | Object | - | 必需。全局提醒插件全局配置。TS 类型:` MessageOptions `
0 commit comments