From ed3c3d60ce79e75062d15ecb1e38552a057dd410 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Tue, 17 Oct 2023 20:22:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(form):=20cascader=E6=94=AF=E6=8C=81check-s?= =?UTF-8?q?trictly/emit-path=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/form/src/fields/Cascader.vue | 6 +++++- packages/form/src/schema.ts | 11 +++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/form/src/fields/Cascader.vue b/packages/form/src/fields/Cascader.vue index 06869bcad..46cefc5eb 100644 --- a/packages/form/src/fields/Cascader.vue +++ b/packages/form/src/fields/Cascader.vue @@ -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" > diff --git a/packages/form/src/schema.ts b/packages/form/src/schema.ts index 1bd5d5142..2215cab13 100644 --- a/packages/form/src/schema.ts +++ b/packages/form/src/schema.ts @@ -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, @@ -545,12 +550,6 @@ export interface CascaderConfig extends FormItem, Input { root: 'string'; item: (optionsData: Record) => CascaderOption[]; }; - add?: { - action: { - method: 'post' | 'get'; - body?: Record; - }; - }; } export interface DynamicFieldConfig extends FormItem {