(component): 升级 vue 3.2.40 与 typescript 4.8.4

This commit is contained in:
就眠儀式
2022-10-07 06:19:05 +08:00
parent 87c8ca7b72
commit 4f8abacac1
6 changed files with 180 additions and 151 deletions

View File

@@ -32,7 +32,7 @@ export interface TreeNodeProps {
showCheckbox: boolean;
showLine: boolean;
selectedKey: any;
checkStrictly: boolean;
checkStrictly: boolean | string;
collapseTransition: boolean;
onlyIconControl: boolean;
}

View File

@@ -20,22 +20,24 @@ export interface OriginalTreeData {
disabled?: boolean;
}
export interface ReplaceFieldsOptions {
id?: string;
children?: string;
title?: string;
}
export interface TreeProps {
checkedKeys?: KeysType;
selectedKey?: any;
data: OriginalTreeData;
showCheckbox?: boolean;
checkStrictly?: boolean;
disabled?: boolean;
edit?: EditType;
checkedKeys?: KeysType;
checkStrictly?: boolean | string;
collapseTransition?: boolean;
onlyIconControl?: boolean;
selectedKey?: any;
showLine?: boolean;
disabled?: boolean;
replaceFields?: {
id?: string;
children?: string;
title?: string;
};
showCheckbox?: boolean;
replaceFields?: ReplaceFieldsOptions;
}
interface TreeEmits {

View File

@@ -26,7 +26,7 @@ interface ReplaceFields {
}
interface TreeConfig {
checkStrictly: boolean;
checkStrictly: boolean | string;
showCheckbox: boolean;
checkedKeys: StringOrNumber[];
expandKeys: StringOrNumber[];
@@ -135,7 +135,7 @@ class Tree {
treeForeach(tree: any, func: Function) {
tree.forEach((data: any) => {
data.children && this.treeForeach(data.children, func); // 遍历子树
data.children && this.treeForeach(data.children, func);
func(data);
});
}
@@ -181,7 +181,7 @@ class Tree {
}
}
setCheckedKeys(checked: boolean, checkStrictly: boolean, node: TreeData) {
setCheckedKeys(checked: boolean, checkStrictly: boolean | string, node: TreeData) {
node.isChecked = checked;
if (!checkStrictly) {
if (node.parentNode) {

View File

@@ -11,21 +11,23 @@ export interface OriginalTreeData {
disabled?: boolean;
}
export interface ReplaceFieldsOptions {
id?: string;
children?: string;
title?: string;
}
export interface TreeProps {
checkedKeys?: KeysType;
expandKeys?: KeysType;
data: OriginalTreeData;
checkStrictly?: boolean;
checkStrictly?: boolean | string;
showCheckbox?: boolean;
edit?: EditType;
collapseTransition?: boolean;
onlyIconControl?: boolean;
showLine?: boolean;
replaceFields?: {
id?: string;
children?: string;
title?: string;
};
replaceFields?: ReplaceFieldsOptions;
}
export interface TreeEmits {
(e: "update:checkedKeys", keys: KeysType): void;