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 -->
<template>
<el-drawer
:visible.sync="visible"
:visible.sync="drawerVisible"
size="80%"
:wrapperClosable="false"
@close="$emit('update:visible', false)"
@close="drawerVisible = false"
>
<!-- drawer title -->
<template #title>
@@ -72,11 +72,12 @@ export default {
RenderFile,
knowledgeInfo
},
emit: ['update:visible'],
props: {
visible: Boolean,
descriptions: {
type: Object,
default: () => ({ data: [] })
default: () => ({data: []})
},
documentDetail: {
type: Object,
@@ -95,6 +96,16 @@ export default {
metadataDialogVisible: false
}
},
computed: {
drawerVisible: {
get() {
return this.visible
},
set(value) {
this.$emit('update:visible', value)
}
}
},
watch: {
activeSegment(newVal) {
this.localActiveSegment = newVal