mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-02-17 13:20:52 +08:00
feat(dialog): add close
slot (#5417)
This commit is contained in:
parent
0f79c83fa3
commit
da1a0f38d4
@ -27,6 +27,7 @@
|
||||
- `n-upload` adds `file-list-class` and `trigger-class` props.
|
||||
- `n-dynamic-input` adds `input-class` and `tag-class` props.
|
||||
- `n-dynamic-input` adds `item-class` prop.
|
||||
- `n-dialog` adds `close` slot.
|
||||
|
||||
## 2.35.0
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
- `n-upload` 新增 `file-list-class` 和 `trigger-class` 属性
|
||||
- `n-dynamic-input` 新增 `input-class` 和 `tag-class` 属性
|
||||
- `n-dynamic-input` 新增 `item-class` 属性
|
||||
- `n-dialog` 新增 `close` 插槽
|
||||
|
||||
## 2.35.0
|
||||
|
||||
|
@ -160,3 +160,4 @@ All the properties can be modified dynamically.
|
||||
| default | `()` | Dialog content. |
|
||||
| header | `()` | `Header` content. |
|
||||
| icon | `()` | `Icon` content. |
|
||||
| close | `()` | `Close` content. |
|
||||
|
@ -161,3 +161,4 @@ focus-debug.vue
|
||||
| default | `()` | 对话框内容 |
|
||||
| header | `()` | `header` 内容 |
|
||||
| icon | `()` | `icon` 内容 |
|
||||
| close | `()` | `close` 内容 |
|
||||
|
@ -246,7 +246,14 @@ export const NDialog = defineComponent({
|
||||
style={cssVars as CSSProperties}
|
||||
role="dialog"
|
||||
>
|
||||
{closable ? (
|
||||
{this.$slots.close ? (
|
||||
<div
|
||||
class={`${mergedClsPrefix}-dialog__close`}
|
||||
clsPrefix={mergedClsPrefix}
|
||||
>
|
||||
{this.$slots.close?.()}
|
||||
</div>
|
||||
) : closable ? (
|
||||
<NBaseClose
|
||||
clsPrefix={mergedClsPrefix}
|
||||
class={`${mergedClsPrefix}-dialog__close`}
|
||||
|
Loading…
Reference in New Issue
Block a user