refactor: tree component empty state display (#853)

This commit is contained in:
zhangfugui 2021-07-04 21:08:15 +08:00 committed by GitHub
parent f1c0e0c52b
commit 186b274faa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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