mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-19 03:55:50 +08:00
feat(form,form-schema): group list支持配置默认展开数量
This commit is contained in:
parent
b72f4dae28
commit
6b4ca4b83a
@ -720,6 +720,12 @@ export interface GroupListConfig extends FormItem {
|
|||||||
title?: string | FilterFunction<string>;
|
title?: string | FilterFunction<string>;
|
||||||
itemExtra?: string | FilterFunction<string>;
|
itemExtra?: string | FilterFunction<string>;
|
||||||
expandAll?: boolean;
|
expandAll?: boolean;
|
||||||
|
/**
|
||||||
|
* 默认展开的数量,用于控制分组列表默认展示的项数
|
||||||
|
* 当设置为数字时,表示默认展开指定数量的项
|
||||||
|
* 当未设置时,默认展开第一项
|
||||||
|
*/
|
||||||
|
defaultExpandQuantity?: number;
|
||||||
addable?: (mForm: FormState | undefined, data: any) => boolean | 'undefined' | boolean;
|
addable?: (mForm: FormState | undefined, data: any) => boolean | 'undefined' | boolean;
|
||||||
defaultAdd?: (mForm: FormState | undefined, data: any) => any;
|
defaultAdd?: (mForm: FormState | undefined, data: any) => any;
|
||||||
delete?: (model: any, index: number | string | symbol, values: any) => boolean | boolean;
|
delete?: (model: any, index: number | string | symbol, values: any) => boolean | boolean;
|
||||||
|
@ -133,7 +133,9 @@ const props = defineProps<{
|
|||||||
const emit = defineEmits(['swap-item', 'remove-item', 'change', 'addDiffCount', 'copy-item']);
|
const emit = defineEmits(['swap-item', 'remove-item', 'change', 'addDiffCount', 'copy-item']);
|
||||||
|
|
||||||
const mForm = inject<FormState | undefined>('mForm');
|
const mForm = inject<FormState | undefined>('mForm');
|
||||||
const expand = ref(props.config.expandAll || !props.index);
|
|
||||||
|
const defaultExpandQuantity = props.config.defaultExpandQuantity ?? 7;
|
||||||
|
const expand = ref(props.config.expandAll || defaultExpandQuantity > props.index);
|
||||||
|
|
||||||
const rowConfig = computed(() => ({
|
const rowConfig = computed(() => ({
|
||||||
type: 'row',
|
type: 'row',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user