feat(form): cascader支持check-strictly/emit-path配置

This commit is contained in:
roymondchen 2023-10-17 20:22:52 +08:00
parent e4613ba053
commit ed3c3d60ce
2 changed files with 10 additions and 7 deletions

View File

@ -9,7 +9,11 @@
:placeholder="config.placeholder" :placeholder="config.placeholder"
:disabled="disabled" :disabled="disabled"
:options="options" :options="options"
:props="{ multiple: config.multiple }" :props="{
multiple: config.multiple ?? false,
emitPath: config.emitPath ?? true,
checkStrictly: config.checkStrictly ?? false,
}"
@change="changeHandler" @change="changeHandler"
></TMagicCascader> ></TMagicCascader>
</template> </template>

View File

@ -527,7 +527,12 @@ export interface LinkConfig extends FormItem {
export interface CascaderConfig extends FormItem, Input { export interface CascaderConfig extends FormItem, Input {
type: 'cascader'; type: 'cascader';
remote?: boolean; remote?: boolean;
/** 在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false则只返回该节点的值默认 true */
emitPath?: boolean;
/** 是否多选,默认 false */
multiple?: boolean; multiple?: boolean;
/** 是否严格的遵守父子节点不互相关联,默认 false */
checkStrictly?: boolean;
options?: options?:
| (( | ((
mForm: FormState | undefined, mForm: FormState | undefined,
@ -545,12 +550,6 @@ export interface CascaderConfig extends FormItem, Input {
root: 'string'; root: 'string';
item: (optionsData: Record<string, any>) => CascaderOption[]; item: (optionsData: Record<string, any>) => CascaderOption[];
}; };
add?: {
action: {
method: 'post' | 'get';
body?: Record<string, any>;
};
};
} }
export interface DynamicFieldConfig extends FormItem { export interface DynamicFieldConfig extends FormItem {