diff --git a/src/renderer/src/views/components/propertyBox/graph.vue b/src/renderer/src/views/components/propertyBox/graph.vue index 7e22939..74fac0c 100644 --- a/src/renderer/src/views/components/propertyBox/graph.vue +++ b/src/renderer/src/views/components/propertyBox/graph.vue @@ -138,7 +138,19 @@ let observer: IntersectionObserver | null = null const treeRef: any = ref('') watch(modelName, (val) => { - treeRef.value!.filter(val) + if (treeRef.value && treeRef.value !== '') { + treeRef.value!.filter(val) + } +}) + +watch(isShowPup, (val) => { + if (!val) { + modelName.value = '' + activeTab.value = '0' + treeRef.value = '' + activeIndex.value = null + categories.value = [] + } }) const filterNode: any = (value, data) => { diff --git a/src/renderer/src/views/components/propertyBox/model.vue b/src/renderer/src/views/components/propertyBox/model.vue index a0173d7..1cf8e22 100644 --- a/src/renderer/src/views/components/propertyBox/model.vue +++ b/src/renderer/src/views/components/propertyBox/model.vue @@ -136,8 +136,22 @@ const loading = ref(false) let observer: IntersectionObserver | null = null const treeRef: any = ref('') + watch(modelName, (val) => { - treeRef.value!.filter(val) + if (treeRef.value && treeRef.value !== '') { + treeRef.value!.filter(val) + } +}) + +watch(isShowPup, (val) => { + if (!val) { + modelName.value = '' + activeTab.value = '0' + treeRef.value = '' + activeIndex.value = null + addType.value = '' + categories.value = [] + } }) const filterNode: any = (value, data) => {