Browse Source

refactor: tree component empty state display (#853)

zhangfugui 3 years ago
parent
commit
186b274faa
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/components/Tree/src/Tree.vue

+ 2 - 2
src/components/Tree/src/Tree.vue

@@ -105,7 +105,7 @@
       );
 
       const getNotFound = computed((): boolean => {
-        return searchState.startSearch && searchState.searchData?.length === 0;
+        return !getTreeData.value || getTreeData.value.length === 0;
       });
 
       const {
@@ -381,7 +381,7 @@
               </Tree>
             </ScrollContainer>
 
-            <Empty v-show={unref(getNotFound)} class="!mt-4" />
+            <Empty v-show={unref(getNotFound)} image={Empty.PRESENTED_IMAGE_SIMPLE} class="!mt-4" />
           </div>
         );
       };