Skip to content
Open
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
10 changes: 10 additions & 0 deletions packages/components/dialog/dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@

如果您不确定问题是否是由该规则引起的,或者确定该规则不是问题的根本原因,请在 `GitHub` 上提出一个 `issue`,并提供可以重现问题的代码。这将有助于我们更好地了解您的问题并提供更好的帮助。

### 多层 Dialog 嵌套时,外层 Dialog 开启 destroy-on-close 后出现异常的情况?

使用嵌套多层使用 dialog 且最外层开启了 `destroy-on-close` ,会出现框架层的报错:

> Uncaught (in promise) NotFoundError: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.

解决方法: 除最后一层 dialog,外层的所有 dialog 都设置 `lazy` 为`true`;

详情见 [issue](https://github.com/Tencent/tdesign-vue-next/pull/5659),可通过此[链接](https://stackblitz.com/edit/vitejs-vite-vnywg115?file=src%2FApp.vue)体验。

## API

### DialogCard Props
Expand Down
4 changes: 2 additions & 2 deletions packages/components/dialog/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
} from 'vue';
import { DialogCloseContext } from './type';
import props from './props';
import { useConfig, useTeleport, usePrefixClass, usePopupManager, useDestroyOnClose } from '@tdesign/shared-hooks';

Check warning on line 15 in packages/components/dialog/dialog.tsx

View workflow job for this annotation

GitHub Actions / lint

'useTeleport' is defined but never used. Allowed unused vars must match /^_/u
import { useSameTarget } from './hooks';

import { getScrollbarWidth } from '@tdesign/common-js/utils/getScrollbarWidth';
Expand Down Expand Up @@ -55,7 +55,7 @@
emitCloseEvent({ e: context.e, trigger: 'cancel' });
};
// teleport容器
const teleportElement = useTeleport(() => props.attach);
// const teleportElement = useTeleport(() => props.attach);
useDestroyOnClose();
const timer = ref();
const styleEl = ref();
Expand Down Expand Up @@ -294,7 +294,7 @@
];

return (
<Teleport disabled={!props.attach || !teleportElement.value} to={teleportElement.value}>
<Teleport disabled={!props.attach} to={props.attach}>
<Transition
duration={300}
name={`${COMPONENT_NAME.value}-zoom__vue`}
Expand Down
Loading