fix: 表格的表单搜索无法在modal/drawer中使用 https://gitee.com/dapppp/ruoyi-plus-vben5/issues/IB0960
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from '@vben/types';
|
||||
|
||||
import { nextTick, ref } from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui';
|
||||
@@ -79,24 +79,8 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
},
|
||||
});
|
||||
|
||||
const init = ref(true);
|
||||
const [RoleAssignDrawer, drawerApi] = useVbenDrawer({
|
||||
connectedComponent: roleAssignDrawer,
|
||||
/**
|
||||
* TODO: 等待官方修复
|
||||
* 临时解决方案 for https://github.com/vbenjs/vue-vben-admin/issues/4752
|
||||
* 通过在关闭时使用v-if切换来造成Modal的重新渲染
|
||||
* 目前Modal逻辑为每次打开 内部的元素会重新mount 但是Modal本身不会重新渲染
|
||||
* 该方案会造成关闭动画丢失(应该放在afterClose中)
|
||||
* @param isOpen 是否打开
|
||||
*/
|
||||
onOpenChange: async (isOpen) => {
|
||||
if (!isOpen) {
|
||||
init.value = false;
|
||||
await nextTick();
|
||||
init.value = true;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
@@ -172,6 +156,6 @@ function handleMultipleAuthCancel() {
|
||||
</Popconfirm>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<RoleAssignDrawer v-if="init" @reload="tableApi.query()" />
|
||||
<RoleAssignDrawer @reload="tableApi.query()" />
|
||||
</Page>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user