Skip to content

Commit

Permalink
docs: Message
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 committed Nov 8, 2023
1 parent ffcdc59 commit 3bc020a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ closeBtn | String / Boolean / Slot / Function | undefined | Typescript:`string
content | String / Slot / Function | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
duration | Number | 3000 | \- | N
icon | Boolean / Slot / Function | true | Typescript:`boolean \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
theme | String | info | optionsinfo/success/warning/error/question/loading。Typescript:`MessageThemeList` `type MessageThemeList = 'info' \| 'success' \| 'warning' \| 'error' \| 'question' \| 'loading'`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/message/type.ts) | N
theme | String | info | options: info/success/warning/error/question/loading。Typescript:`MessageThemeList` `type MessageThemeList = 'info' \| 'success' \| 'warning' \| 'error' \| 'question' \| 'loading'`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/message/type.ts) | N
onClose | Function | | Typescript:`(context: { trigger: 'close-click' \| 'duration-end', e?: MouseEvent }) => void`<br/>close message event | N
onCloseBtnClick | Function | | Typescript:`(context: { e: MouseEvent }) => void`<br/> | N
onDurationEnd | Function | | Typescript:`() => void`<br/> | N
Expand All @@ -29,10 +29,10 @@ name | type | default | description | required
attach | String / Function | 'body' | Typescript:`AttachNode`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
className | String | - | HTMLElement class | N
offset | Array | - | Typescript:`Array<string \| number>` | N
placement | String | top | optionscenter/top/left/right/bottom/top-left/top-right/bottom-left/bottom-right。Typescript:`MessagePlacementList` `type MessagePlacementList = 'center' \| 'top' \| 'left' \| 'right' \| 'bottom' \| 'top-left' \| 'top-right' \| 'bottom-left' \| 'bottom-right'`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/message/type.ts) | N
placement | String | top | options: center/top/left/right/bottom/top-left/top-right/bottom-left/bottom-right。Typescript:`MessagePlacementList` `type MessagePlacementList = 'center' \| 'top' \| 'left' \| 'right' \| 'bottom' \| 'top-left' \| 'top-right' \| 'bottom-left' \| 'bottom-right'`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/message/type.ts) | N
style | Object | - | CSS style。Typescript:`CSSProperties` | N
zIndex | Number | 5000 | \- | N
`MessageProps` | \- | - | \- | N
`MessageProps` | \- | - | extends `MessageProps` | N

### MessagePlugin

Expand Down
2 changes: 1 addition & 1 deletion packages/products/tdesign-vue-next/src/message/message.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ offset | Array | - | 相对于 placement 的偏移量,示例:[-10, 20] 或 [
placement | 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/tree/develop/src/message/type.ts) | N
style | Object | - | 内敛样式。TS 类型:`CSSProperties` | N
zIndex | Number | 5000 | 消息层级 | N
`MessageProps` | \- | - | 继承 `MessageProps` 中的全部 API | N
`MessageProps` | \- | - | 继承 `MessageProps` 中的全部属性 | N

### MessagePlugin

Expand Down
4 changes: 2 additions & 2 deletions packages/products/tdesign-vue-next/src/message/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default {
/** 关闭按钮,可以自定义。值为 true 显示默认关闭按钮,值为 false 不显示关闭按钮。值类型为 string 则直接显示值,如:“关闭”。也可以完全自定义按钮 */
closeBtn: {
type: [String, Boolean, Function] as PropType<TdMessageProps['closeBtn']>,
default: undefined,
default: undefined as TdMessageProps['closeBtn'],
},
/** 用于自定义消息弹出内容 */
content: {
Expand All @@ -25,7 +25,7 @@ export default {
/** 用于自定义消息前面的图标,优先级大于 theme 设定的图标。值为 false 则不显示图标,值为 true 显示 theme 设定图标 */
icon: {
type: [Boolean, Function] as PropType<TdMessageProps['icon']>,
default: true,
default: true as TdMessageProps['icon'],
},
/** 消息组件风格 */
theme: {
Expand Down
3 changes: 2 additions & 1 deletion packages/products/tdesign-vue-next/src/message/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* */

import { TNode, AttachNode } from '../common';
import { CSSProperties } from 'vue';

export interface TdMessageProps {
/**
Expand Down Expand Up @@ -67,7 +68,7 @@ export interface MessageOptions extends TdMessageProps {
/**
* 内敛样式
*/
style?: object;
style?: CSSProperties;
/**
* 消息层级
* @default 5000
Expand Down
6 changes: 3 additions & 3 deletions packages/products/tdesign-vue/src/message/message.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ closeBtn | String / Boolean / Slot / Function | undefined | Typescript:`string
content | String / Slot / Function | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
duration | Number | 3000 | \- | N
icon | Boolean / Slot / Function | true | Typescript:`boolean \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
theme | String | info | optionsinfo/success/warning/error/question/loading。Typescript:`MessageThemeList` `type MessageThemeList = 'info' \| 'success' \| 'warning' \| 'error' \| 'question' \| 'loading'`[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/message/type.ts) | N
theme | String | info | options: info/success/warning/error/question/loading。Typescript:`MessageThemeList` `type MessageThemeList = 'info' \| 'success' \| 'warning' \| 'error' \| 'question' \| 'loading'`[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/message/type.ts) | N
onClose | Function | | Typescript:`(context: { trigger: 'close-click' \| 'duration-end', e?: MouseEvent }) => void`<br/>close message event | N
onCloseBtnClick | Function | | Typescript:`(context: { e: MouseEvent }) => void`<br/> | N
onDurationEnd | Function | | Typescript:`() => void`<br/> | N
Expand All @@ -29,10 +29,10 @@ name | type | default | description | required
attach | String / Function | 'body' | Typescript:`AttachNode`[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
className | String | - | HTMLElement class | N
offset | Array | - | Typescript:`Array<string \| number>` | N
placement | String | top | optionscenter/top/left/right/bottom/top-left/top-right/bottom-left/bottom-right。Typescript:`MessagePlacementList` `type MessagePlacementList = 'center' \| 'top' \| 'left' \| 'right' \| 'bottom' \| 'top-left' \| 'top-right' \| 'bottom-left' \| 'bottom-right'`[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/message/type.ts) | N
placement | String | top | options: center/top/left/right/bottom/top-left/top-right/bottom-left/bottom-right。Typescript:`MessagePlacementList` `type MessagePlacementList = 'center' \| 'top' \| 'left' \| 'right' \| 'bottom' \| 'top-left' \| 'top-right' \| 'bottom-left' \| 'bottom-right'`[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/message/type.ts) | N
style | Object | - | CSS style。Typescript:`CSSProperties` | N
zIndex | Number | 5000 | \- | N
`MessageProps` | \- | - | \- | N
`MessageProps` | \- | - | extends `MessageProps` | N

### MessagePlugin

Expand Down
2 changes: 1 addition & 1 deletion packages/products/tdesign-vue/src/message/message.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ offset | Array | - | 相对于 placement 的偏移量,示例:[-10, 20] 或 [
placement | 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/tree/develop/src/message/type.ts) | N
style | Object | - | 内敛样式。TS 类型:`CSSProperties` | N
zIndex | Number | 5000 | 消息层级 | N
`MessageProps` | \- | - | 继承 `MessageProps` 中的全部 API | N
`MessageProps` | \- | - | 继承 `MessageProps` 中的全部属性 | N

### MessagePlugin

Expand Down

0 comments on commit 3bc020a

Please sign in to comment.