解决参数配置组件显示错误

This commit is contained in:
icssoa 2022-07-18 11:14:22 +08:00
parent 3715d2c641
commit ba28f1332b

View File

@ -17,7 +17,7 @@
<cl-pagination />
</el-row>
<cl-upsert ref="Upsert">
<cl-upsert ref="Upsert" @opened="onUpsertOpened">
<template #slot-content="{ scope }">
<div v-for="(item, index) in tab.list" :key="index" class="editor">
<template v-if="tab.index == index">
@ -152,19 +152,7 @@ const Upsert = useUpsert({
}
}
}
],
onOpen(isEdit, data) {
tab.index = null;
nextTick(() => {
if (isEdit) {
tab.index = /<*>/g.test(data.data) ? 1 : 0;
} else {
tab.index = 1;
}
});
}
]
});
//
@ -178,6 +166,19 @@ function changeTab(i: number) {
})
.catch(() => null);
}
//
function onUpsertOpened(isEdit: boolean, data: any) {
tab.index = null;
nextTick(() => {
if (isEdit) {
tab.index = /<*>/g.test(data.data) ? 1 : 0;
} else {
tab.index = 1;
}
});
}
</script>
<style lang="scss" scoped>