fix 修复因 ts 导致的 build error

pull/3/head
yupi 3 years ago
parent 43883ba793
commit 54070b5bd2

@ -51,7 +51,7 @@
<script setup lang="ts">
import { ref, watch } from "vue";
const props = defineProps<{ tree: InvokeTree }>();
const props = defineProps<{ tree?: InvokeTree }>();
const tree = ref(props.tree);
if (!tree.value) {
@ -101,10 +101,13 @@ const generateList = (data: InvokeTreeNode[], preKey: string) => {
generateList(tree.value, "");
watch(searchValue, (value) => {
if (!tree?.value) {
return;
}
expandedKeys.value = dataList
.map((item: InvokeTreeNode) => {
if (item.title.indexOf(value) > -1) {
return getParentKey(item.key, tree.value);
return getParentKey(item.key, tree.value as InvokeTree);
}
return null;
})

Loading…
Cancel
Save