Browse Source

fix: 修复菜单管理回显问题

kailong321200875 1 năm trước cách đây
mục cha
commit
d9ca9ba5e8
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      src/views/Authorization/Menu/components/Write.vue

+ 4 - 2
src/views/Authorization/Menu/components/Write.vue

@@ -8,6 +8,7 @@ import { getMenuListApi } from '@/api/menu'
 import { ElTag } from 'element-plus'
 import AddButtonPermission from './AddButtonPermission.vue'
 import { BaseButton } from '@/components/Button'
+import { cloneDeep } from 'lodash-es'
 
 const { t } = useI18n()
 
@@ -271,8 +272,9 @@ const cacheComponent = ref('')
 
 watch(
   () => props.currentRow,
-  (currentRow) => {
-    if (!currentRow) return
+  (value) => {
+    if (!value) return
+    const currentRow = cloneDeep(value)
     cacheComponent.value = currentRow.type === 1 ? currentRow.component : ''
     if (currentRow.parentId === 0) {
       setSchema([