fix: 修复抽屉关闭数据流向异常的问题

This commit is contained in:
Huangzhe
2025-05-15 23:17:55 +08:00
parent 56ce3236ce
commit df8b5e94ba

View File

@@ -1,10 +1,10 @@
<!-- src/views/knowledge/detail/components/DocumentDrawer.vue --> <!-- src/views/knowledge/detail/components/DocumentDrawer.vue -->
<template> <template>
<el-drawer <el-drawer
:visible.sync="visible" :visible.sync="drawerVisible"
size="80%" size="80%"
:wrapperClosable="false" :wrapperClosable="false"
@close="$emit('update:visible', false)" @close="drawerVisible = false"
> >
<!-- drawer title --> <!-- drawer title -->
<template #title> <template #title>
@@ -72,6 +72,7 @@ export default {
RenderFile, RenderFile,
knowledgeInfo knowledgeInfo
}, },
emit: ['update:visible'],
props: { props: {
visible: Boolean, visible: Boolean,
descriptions: { descriptions: {
@@ -95,6 +96,16 @@ export default {
metadataDialogVisible: false metadataDialogVisible: false
} }
}, },
computed: {
drawerVisible: {
get() {
return this.visible
},
set(value) {
this.$emit('update:visible', value)
}
}
},
watch: { watch: {
activeSegment(newVal) { activeSegment(newVal) {
this.localActiveSegment = newVal this.localActiveSegment = newVal