fix:【ele】【mall】修复 diy-editor 拖拽后,无法切回“index”首页的问题

This commit is contained in:
YunaiV
2025-11-02 19:59:30 +08:00
parent b4ed04f695
commit dd86598833
2 changed files with 7 additions and 2 deletions

View File

@@ -79,7 +79,7 @@ const handleCloneComponent = (component: DiyComponent<any>) => {
:group="{ name: 'component', pull: 'clone', put: false }"
:clone="handleCloneComponent"
:animation="200"
:force-fallback="true"
:force-fallback="false"
>
<template #item="{ element }">
<div>

View File

@@ -112,6 +112,11 @@ watch(
if (!val || selectedComponentIndex.value === -1) {
return;
}
// 如果是基础设置页,默认选中的索引改成 -1为了防止删除组件后切换到此页导致报错
// https://gitee.com/yudaocode/yudao-ui-admin-vue3/pulls/792
if (props.showTabBar) {
selectedComponentIndex.value = -1;
}
pageComponents.value[selectedComponentIndex.value] =
selectedComponent.value!;
},
@@ -382,7 +387,7 @@ onMounted(() => {
<draggable
v-model="pageComponents"
:animation="200"
:force-fallback="true"
:force-fallback="false"
class="page-prop-area drag-area"
filter=".component-toolbar"
ghost-class="draggable-ghost"