mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2025-12-15 07:27:54 +00:00
解决参数配置组件显示错误
This commit is contained in:
parent
3715d2c641
commit
ba28f1332b
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user