Skip to content

Commit

Permalink
feat(form): cascader支持check-strictly/emit-path配置
Browse files Browse the repository at this point in the history
  • Loading branch information
roymondchen committed Oct 17, 2023
1 parent e4613ba commit ed3c3d6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
6 changes: 5 additions & 1 deletion packages/form/src/fields/Cascader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
:placeholder="config.placeholder"
:disabled="disabled"
:options="options"
:props="{ multiple: config.multiple }"
:props="{
multiple: config.multiple ?? false,
emitPath: config.emitPath ?? true,
checkStrictly: config.checkStrictly ?? false,
}"
@change="changeHandler"
></TMagicCascader>
</template>
Expand Down
11 changes: 5 additions & 6 deletions packages/form/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,12 @@ export interface LinkConfig extends FormItem {
export interface CascaderConfig extends FormItem, Input {
type: 'cascader';
remote?: boolean;
/** 在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值,默认 true */
emitPath?: boolean;
/** 是否多选,默认 false */
multiple?: boolean;
/** 是否严格的遵守父子节点不互相关联,默认 false */
checkStrictly?: boolean;
options?:
| ((
mForm: FormState | undefined,
Expand All @@ -545,12 +550,6 @@ export interface CascaderConfig extends FormItem, Input {
root: 'string';
item: (optionsData: Record<string, any>) => CascaderOption[];
};
add?: {
action: {
method: 'post' | 'get';
body?: Record<string, any>;
};
};
}

export interface DynamicFieldConfig extends FormItem {
Expand Down

0 comments on commit ed3c3d6

Please sign in to comment.