chore(BasicTree): Resolve ts type error

This commit is contained in:
invalid w 2023-10-20 16:47:03 +08:00
parent c42ba1cc1b
commit 3d0b88708e
2 changed files with 3 additions and 2 deletions

View File

@ -33,6 +33,7 @@
import { CreateContextOptions } from '/@/components/ContextMenu';
import { treeEmits, treeProps } from './types/tree';
import { createBEM } from '/@/utils/bem';
import type { TreeProps } from 'ant-design-vue/es/tree/Tree';
export default defineComponent({
name: 'BasicTree',
@ -106,7 +107,7 @@
},
onRightClick: handleRightClick,
};
return omit(propsData, 'treeData', 'class');
return omit(propsData, 'treeData', 'class') as TreeProps;
});
const getTreeData = computed((): TreeItem[] =>

View File

@ -8,5 +8,5 @@ export const TreeIcon = ({ icon }: { icon: VNode | string }) => {
if (isString(icon)) {
return h(Icon, { icon, class: 'mr-1' });
}
return Icon;
return h(Icon);
};