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 @@ -14,6 +14,7 @@ export const dialogDefaultProps: TdDialogProps = {
footer: true,
forceRender: false,
header: true,
lazy: false,
mode: 'modal',
placement: 'top',
preventScrollThrough: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ draggable | Boolean | false | \- | N
footer | TNode | true | Typescript:`boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
forceRender | Boolean | false | to force render Dialog | N
header | TNode | true | Typescript:`string \| boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
lazy | Boolean | false | Enable Dialog lazy loading, the contents of the dialog box are not rendered when enable | N
mode | String | modal | options: modal/modeless/normal/full-screen | N
placement | String | top | options: top/center | N
preventScrollThrough | Boolean | true | \- | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ draggable | Boolean | false | 对话框是否可以拖拽(仅在非模态对
footer | TNode | true | 底部操作栏,默认会有“确认”和“取消”两个按钮。值为 true 显示默认操作按钮,值为 false 不显示任何内容,值类型为 Function 表示自定义底部内容。TS 类型:`boolean \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
forceRender | Boolean | false | 是否强制渲染Dialog | N
header | TNode | true | 头部内容。值为 true 显示空白头部,值为 false 不显示任何内容,值类型为 string 则直接显示值,值类型为 Function 表示自定义头部内容。TS 类型:`string \| boolean \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N
lazy | Boolean | false | 是否启用对话框懒加载,启用时对话框内的内容不渲染 | N
mode | String | modal | 对话框类型,有 4 种:模态对话框、非模态对话框、普通对话框、全屏对话框。弹出「模态对话框」时,只能操作对话框里面的内容,不能操作其他内容。弹出「非模态对话框」时,则可以操作页面内所有内容。「普通对话框」是指没有脱离文档流的对话框,可以在这个基础上开发更多的插件。可选项:modal/modeless/normal/full-screen | N
placement | String | top | 对话框位置,内置两种:垂直水平居中显示 和 靠近顶部(top:20%)显示。默认情况,为避免贴顶或贴底,顶部和底部距离最小为 `48px`,可通过调整 `top` 覆盖默认大小。可选项:top/center | N
preventScrollThrough | Boolean | true | 防止滚动穿透 | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ export interface TdDialogProps {
* @default true
*/
header?: TNode;
/**
* 是否启用对话框懒加载,启用时对话框内的内容不渲染
* @default false
*/
lazy?: boolean;
/**
* 对话框类型,有 4 种:模态对话框、非模态对话框、普通对话框、全屏对话框。弹出「模态对话框」时,只能操作对话框里面的内容,不能操作其他内容。弹出「非模态对话框」时,则可以操作页面内所有内容。「普通对话框」是指没有脱离文档流的对话框,可以在这个基础上开发更多的插件
* @default modal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,26 @@

name | type | default | description | required
-- | -- | -- | -- | --
body | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
cancelBtn | String / Object / Slot / Function | - | Typescript:`string \| ButtonProps \| TNode \| null`,[Button API Documents](./button?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/dialog/type.ts) | N
closeBtn | String / Boolean / Slot / Function | true | Typescript:`string \| ButtonProps \| TNode \| null`,[Button API Documents](./button?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/dialog/type.ts) | N
confirmBtn | String / Object / Slot / Function | true | Typescript:`string \| ButtonProps \| TNode \| null`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
confirmLoading | Boolean | - | confirm button loading status。Typescript:`string \| ButtonProps \| TNode \| null`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
footer | Boolean / Slot / Function | true | Typescript:`boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
header | String / Boolean / Slot / Function | true | Typescript:`string \| boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
theme | String | default | options: default/info/warning/danger/success | N
`Pick<DialogProps, 'body' \| 'cancelBtn' \| 'closeBtn' \| 'confirmBtn' \| 'footer' \| 'header' \| 'theme' \| 'onCancel' \| 'onCloseBtnClick' \| 'onConfirm' \| 'confirmLoading'>` | String / Slot / Function | - | extends `Pick<DialogProps, 'body' \| 'cancelBtn' \| 'closeBtn' \| 'confirmBtn' \| 'footer' \| 'header' \| 'theme' \| 'onCancel' \| 'onCloseBtnClick' \| 'onConfirm' \| 'confirmLoading'>`。Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
onCancel | Function | | Typescript:`(context: { e: MouseEvent }) => void`<br/>options: default/info/warning/danger/success | N
onCloseBtnClick | Function | | Typescript:`(context: { e: MouseEvent }) => void`<br/>options: default/info/warning/danger/success | N
onConfirm | Function | | Typescript:`(context: { e: MouseEvent \| KeyboardEvent }) => void`<br/>options: default/info/warning/danger/success | N

### DialogCard Events

name | params | description
-- | -- | --
cancel | `(context: { e: MouseEvent })` | options: default/info/warning/danger/success
close-btn-click | `(context: { e: MouseEvent })` | options: default/info/warning/danger/success
confirm | `(context: { e: MouseEvent \| KeyboardEvent })` | options: default/info/warning/danger/success


### Dialog Props
Expand All @@ -29,6 +48,7 @@ dialogStyle | Object | - | Styles that apply to the dialog box itself。Typescri
draggable | Boolean | false | \- | N
footer | Boolean / Slot / Function | true | Typescript:`boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
header | String / Boolean / Slot / Function | true | Typescript:`string \| boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
lazy | Boolean | false | Enable Dialog lazy loading, the contents of the dialog box are not rendered when enable | N
mode | String | modal | options: modal/modeless/normal/full-screen | N
placement | String | top | options: top/center | N
preventScrollThrough | Boolean | true | \- | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,26 @@

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
body | String / Slot / Function | - | 对话框内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
cancelBtn | String / Object / Slot / Function | - | 取消按钮,可自定义。值为 null 则不显示取消按钮。值类型为字符串,则表示自定义按钮文本,值类型为 Object 则表示透传 Button 组件属性。使用 TNode 自定义按钮时,需自行控制取消事件。TS 类型:`string \| ButtonProps \| TNode \| null`,[Button API Documents](./button?tab=api)。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/dialog/type.ts) | N
closeBtn | String / Boolean / Slot / Function | true | 关闭按钮,可以自定义。值为 true 显示默认关闭按钮,值为 false 不显示关闭按钮。值类型为 string 则直接显示值,如:“关闭”。值类型为 TNode,则表示呈现自定义按钮示例。TS 类型:`string \| ButtonProps \| TNode \| null`,[Button API Documents](./button?tab=api)。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/dialog/type.ts) | N
confirmBtn | String / Object / Slot / Function | true | 确认按钮。值为 null 则不显示确认按钮。值类型为字符串,则表示自定义按钮文本,值类型为 Object 则表示透传 Button 组件属性。使用 TNode 自定义按钮时,需自行控制确认事件。TS 类型:`string \| ButtonProps \| TNode \| null`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
confirmLoading | Boolean | - | 确认按钮加载状态。TS 类型:`string \| ButtonProps \| TNode \| null`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
footer | Boolean / Slot / Function | true | 底部操作栏,默认会有“确认”和“取消”两个按钮。值为 true 显示默认操作按钮,值为 false 不显示任何内容,值类型为 Function 表示自定义底部内容。TS 类型:`boolean \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
header | String / Boolean / Slot / Function | true | 头部内容。值为 true 显示空白头部,值为 false 不显示任何内容,值类型为 string 则直接显示值,值类型为 Function 表示自定义头部内容。TS 类型:`string \| boolean \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
theme | String | default | 对话框风格。可选项:default/info/warning/danger/success | N
`Pick<DialogProps, 'body' \| 'cancelBtn' \| 'closeBtn' \| 'confirmBtn' \| 'footer' \| 'header' \| 'theme' \| 'onCancel' \| 'onCloseBtnClick' \| 'onConfirm' \| 'confirmLoading'>` | String / Slot / Function | - | 继承 `Pick<DialogProps, 'body' \| 'cancelBtn' \| 'closeBtn' \| 'confirmBtn' \| 'footer' \| 'header' \| 'theme' \| 'onCancel' \| 'onCloseBtnClick' \| 'onConfirm' \| 'confirmLoading'>` 中的全部属性。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
onCancel | Function | | TS 类型:`(context: { e: MouseEvent }) => void`<br/>如果“取消”按钮存在,则点击“取消”按钮时触发,同时触发关闭事件。可选项:default/info/warning/danger/success | N
onCloseBtnClick | Function | | TS 类型:`(context: { e: MouseEvent }) => void`<br/>点击右上角关闭按钮时触发。可选项:default/info/warning/danger/success | N
onConfirm | Function | | TS 类型:`(context: { e: MouseEvent \| KeyboardEvent }) => void`<br/>如果“确认”按钮存在,则点击“确认”按钮时触发,或者键盘按下回车键时触发。可选项:default/info/warning/danger/success | N

### DialogCard Events

名称 | 参数 | 描述
-- | -- | --
cancel | `(context: { e: MouseEvent })` | 如果“取消”按钮存在,则点击“取消”按钮时触发,同时触发关闭事件。可选项:default/info/warning/danger/success
close-btn-click | `(context: { e: MouseEvent })` | 点击右上角关闭按钮时触发。可选项:default/info/warning/danger/success
confirm | `(context: { e: MouseEvent \| KeyboardEvent })` | 如果“确认”按钮存在,则点击“确认”按钮时触发,或者键盘按下回车键时触发。可选项:default/info/warning/danger/success


### Dialog Props
Expand All @@ -29,6 +48,7 @@ dialogStyle | Object | - | 作用于对话框本身的样式。TS 类型:`Styl
draggable | Boolean | false | 对话框是否可以拖拽(仅在非模态对话框时有效) | N
footer | Boolean / Slot / Function | true | 底部操作栏,默认会有“确认”和“取消”两个按钮。值为 true 显示默认操作按钮,值为 false 不显示任何内容,值类型为 Function 表示自定义底部内容。TS 类型:`boolean \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
header | String / Boolean / Slot / Function | true | 头部内容。值为 true 显示空白头部,值为 false 不显示任何内容,值类型为 string 则直接显示值,值类型为 Function 表示自定义头部内容。TS 类型:`string \| boolean \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
lazy | Boolean | false | 是否启用对话框懒加载,启用时对话框内的内容不渲染 | N
mode | String | modal | 对话框类型,有 4 种:模态对话框、非模态对话框、普通对话框、全屏对话框。弹出「模态对话框」时,只能操作对话框里面的内容,不能操作其他内容。弹出「非模态对话框」时,则可以操作页面内所有内容。「普通对话框」是指没有脱离文档流的对话框,可以在这个基础上开发更多的插件。可选项:modal/modeless/normal/full-screen | N
placement | String | top | 对话框位置,内置两种:垂直水平居中显示 和 靠近顶部(top:20%)显示。默认情况,为避免贴顶或贴底,顶部和底部距离最小为 `48px`,可通过调整 `top` 覆盖默认大小。可选项:top/center | N
preventScrollThrough | Boolean | true | 防止滚动穿透 | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ export default {
type: [String, Boolean, Function] as PropType<TdDialogProps['header']>,
default: true as TdDialogProps['header'],
},
/** 是否启用对话框懒加载,启用时对话框内的内容不渲染 */
lazy: Boolean,
/** 对话框类型,有 4 种:模态对话框、非模态对话框、普通对话框、全屏对话框。弹出「模态对话框」时,只能操作对话框里面的内容,不能操作其他内容。弹出「非模态对话框」时,则可以操作页面内所有内容。「普通对话框」是指没有脱离文档流的对话框,可以在这个基础上开发更多的插件 */
mode: {
type: String as PropType<TdDialogProps['mode']>,
Expand Down
Loading