chore: 改为onClosed事件中处理

This commit is contained in:
dap 2024-11-01 08:41:47 +08:00
parent a30029a33d
commit 7442c6f15b

View File

@ -196,15 +196,11 @@ const [TableImportModal, tableImportModalApi] = useVbenModal({
* 临时解决方案 for https://github.com/vbenjs/vue-vben-admin/issues/4752 * 临时解决方案 for https://github.com/vbenjs/vue-vben-admin/issues/4752
* 通过在关闭时使用v-if切换来造成Modal的重新渲染 * 通过在关闭时使用v-if切换来造成Modal的重新渲染
* 目前Modal逻辑为每次打开 内部的元素会重新mount 但是Modal本身不会重新渲染 * 目前Modal逻辑为每次打开 内部的元素会重新mount 但是Modal本身不会重新渲染
* 该方案会造成关闭动画丢失(应该放在afterClose中)
* @param isOpen 是否打开
*/ */
onOpenChange: async (isOpen) => { async onClosed() {
if (!isOpen) {
init.value = false; init.value = false;
await nextTick(); await nextTick();
init.value = true; init.value = true;
}
}, },
}); });