Skip to content

Commit 10257e3

Browse files
committed
fix: destroyOnClose incorrect default value, fixed #6092 (#6093)
1 parent a88a2c8 commit 10257e3

File tree

5 files changed

+5
-9
lines changed

5 files changed

+5
-9
lines changed

docs/src/components/common-ui/vben-drawer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const [Drawer, drawerApi] = useVbenDrawer({
7878
| --- | --- | --- | --- |
7979
| appendToMain | 是否挂载到内容区域(默认挂载到body) | `boolean` | `false` |
8080
| connectedComponent | 连接另一个Modal组件 | `Component` | - |
81-
| destroyOnClose | 关闭时销毁`connectedComponent` | `boolean` | `false` |
81+
| destroyOnClose | 关闭时销毁 | `boolean` | `false` |
8282
| title | 标题 | `string\|slot` | - |
8383
| titleTooltip | 标题提示信息 | `string\|slot` | - |
8484
| description | 描述信息 | `string\|slot` | - |

packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ interface Props extends DrawerProps {
3535
const props = withDefaults(defineProps<Props>(), {
3636
appendToMain: false,
3737
closeIconPlacement: 'right',
38-
destroyOnClose: true,
38+
destroyOnClose: false,
3939
drawerApi: undefined,
4040
submitting: false,
4141
zIndex: 1000,

packages/@core/ui-kit/popup-ui/src/drawer/use-drawer.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ import VbenDrawer from './drawer.vue';
2121

2222
const USER_DRAWER_INJECT_KEY = Symbol('VBEN_DRAWER_INJECT');
2323

24-
const DEFAULT_DRAWER_PROPS: Partial<DrawerProps> = {
25-
destroyOnClose: true,
26-
};
24+
const DEFAULT_DRAWER_PROPS: Partial<DrawerProps> = {};
2725

2826
export function setDefaultDrawerProps(props: Partial<DrawerProps>) {
2927
Object.assign(DEFAULT_DRAWER_PROPS, props);

packages/@core/ui-kit/popup-ui/src/modal/modal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ interface Props extends ModalProps {
3434
3535
const props = withDefaults(defineProps<Props>(), {
3636
appendToMain: false,
37-
destroyOnClose: true,
37+
destroyOnClose: false,
3838
modalApi: undefined,
3939
});
4040

packages/@core/ui-kit/popup-ui/src/modal/use-modal.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ import VbenModal from './modal.vue';
1717

1818
const USER_MODAL_INJECT_KEY = Symbol('VBEN_MODAL_INJECT');
1919

20-
const DEFAULT_MODAL_PROPS: Partial<ModalProps> = {
21-
destroyOnClose: true,
22-
};
20+
const DEFAULT_MODAL_PROPS: Partial<ModalProps> = {};
2321

2422
export function setDefaultModalProps(props: Partial<ModalProps>) {
2523
Object.assign(DEFAULT_MODAL_PROPS, props);

0 commit comments

Comments
 (0)