mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-06-18 11:23:39 +08:00
chore(form): fields组件计算lastValues props
This commit is contained in:
parent
a97523e800
commit
d0ec2fd588
@ -32,6 +32,7 @@ const props = defineProps<{
|
||||
prop: string;
|
||||
disabled?: boolean;
|
||||
size?: 'large' | 'default' | 'small';
|
||||
lastValues?: Record<string, any>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['change']);
|
||||
@ -85,7 +86,7 @@ if (typeof props.config.options === 'function' && props.model && mForm) {
|
||||
watchEffect(
|
||||
() => (options.value = (props.config.options as Function)(mForm, { model: props.model, formValues: mForm.values })),
|
||||
);
|
||||
} else if (!props.config.options || !props.config.options.length || props.config.remote) {
|
||||
} else if (!props.config.options?.length || props.config.remote) {
|
||||
Promise.resolve(setRemoteOptions());
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,7 @@ const props = defineProps<{
|
||||
prop: string;
|
||||
disabled?: boolean;
|
||||
size?: 'large' | 'default' | 'small';
|
||||
lastValues?: Record<string, any>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['change']);
|
||||
|
@ -29,6 +29,7 @@ const props = defineProps<{
|
||||
prop: string;
|
||||
disabled?: boolean;
|
||||
size?: 'large' | 'default' | 'small';
|
||||
lastValues?: Record<string, any>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['change']);
|
||||
|
@ -23,6 +23,7 @@ const props = defineProps<{
|
||||
prop: string;
|
||||
disabled?: boolean;
|
||||
size?: 'large' | 'default' | 'small';
|
||||
lastValues?: Record<string, any>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['change']);
|
||||
|
@ -27,6 +27,7 @@ const props = defineProps<{
|
||||
prop: string;
|
||||
disabled?: boolean;
|
||||
size?: 'large' | 'default' | 'small';
|
||||
lastValues?: Record<string, any>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['change']);
|
||||
|
@ -29,6 +29,7 @@ const props = defineProps<{
|
||||
prop: string;
|
||||
disabled?: boolean;
|
||||
size?: 'large' | 'default' | 'small';
|
||||
lastValues?: Record<string, any>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['change']);
|
||||
|
@ -31,6 +31,7 @@ const props = defineProps<{
|
||||
prop: string;
|
||||
disabled?: boolean;
|
||||
size?: 'large' | 'default' | 'small';
|
||||
lastValues?: Record<string, any>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['change']);
|
||||
|
@ -13,6 +13,7 @@ const props = defineProps<{
|
||||
values?: any;
|
||||
name: string;
|
||||
prop: string;
|
||||
lastValues?: Record<string, any>;
|
||||
}>();
|
||||
|
||||
if (props.config.initValue && props.model) {
|
||||
|
@ -40,6 +40,7 @@ const props = defineProps<{
|
||||
prop: string;
|
||||
disabled?: boolean;
|
||||
size?: 'large' | 'default' | 'small';
|
||||
lastValues?: Record<string, any>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['change']);
|
||||
|
@ -13,6 +13,7 @@ const props = defineProps<{
|
||||
values?: any;
|
||||
name: string;
|
||||
prop: string;
|
||||
lastValues?: Record<string, any>;
|
||||
}>();
|
||||
|
||||
useAddField(props.prop);
|
||||
|
@ -34,6 +34,7 @@ const props = defineProps<{
|
||||
prop: string;
|
||||
disabled?: boolean;
|
||||
size?: 'large' | 'default' | 'small';
|
||||
lastValues?: Record<string, any>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['change']);
|
||||
|
@ -32,6 +32,7 @@ const props = defineProps<{
|
||||
prop: string;
|
||||
disabled?: boolean;
|
||||
size?: 'large' | 'default' | 'small';
|
||||
lastValues?: Record<string, any>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['change', 'input']);
|
||||
|
@ -25,6 +25,7 @@ const props = defineProps<{
|
||||
prop: string;
|
||||
disabled?: boolean;
|
||||
size?: 'large' | 'default' | 'small';
|
||||
lastValues?: Record<string, any>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['change']);
|
||||
|
@ -46,6 +46,7 @@ const props = defineProps<{
|
||||
prop: string;
|
||||
disabled?: boolean;
|
||||
size?: 'large' | 'default' | 'small';
|
||||
lastValues?: Record<string, any>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['change']);
|
||||
|
@ -26,6 +26,7 @@ const props = defineProps<{
|
||||
prop: string;
|
||||
disabled?: boolean;
|
||||
size?: 'large' | 'default' | 'small';
|
||||
lastValues?: Record<string, any>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['change']);
|
||||
|
@ -41,6 +41,7 @@ const props = defineProps<{
|
||||
prop: string;
|
||||
disabled?: boolean;
|
||||
size?: 'large' | 'default' | 'small';
|
||||
lastValues?: Record<string, any>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['change', 'input']);
|
||||
|
@ -29,6 +29,7 @@ const props = defineProps<{
|
||||
prop: string;
|
||||
disabled?: boolean;
|
||||
size?: 'large' | 'default' | 'small';
|
||||
lastValues?: Record<string, any>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['change', 'input']);
|
||||
|
@ -25,6 +25,7 @@ const props = defineProps<{
|
||||
prop: string;
|
||||
disabled?: boolean;
|
||||
size?: 'large' | 'default' | 'small';
|
||||
lastValues?: Record<string, any>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['change']);
|
||||
|
@ -87,6 +87,7 @@ export interface FormItem {
|
||||
dynamicKey?: string;
|
||||
/** 是否需要显示`展开更多配置` */
|
||||
expand?: boolean;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface ContainerCommonConfig {
|
||||
@ -567,6 +568,7 @@ export interface TabPaneConfig {
|
||||
onTabClick?: (mForm: FormState | undefined, tab: any, data: any) => void;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface TabConfig extends FormItem, ContainerCommonConfig {
|
||||
type: 'tab' | 'dynamic-tab';
|
||||
tabType?: string;
|
||||
@ -718,6 +720,6 @@ export type ChildConfig =
|
||||
| DynamicFieldConfig
|
||||
| ComponentConfig;
|
||||
|
||||
export type FormConfig = (ChildConfig & { [key: string]: any })[];
|
||||
export type FormConfig = ChildConfig[];
|
||||
|
||||
export type FormValue = Record<string | number, any>;
|
||||
|
Loading…
x
Reference in New Issue
Block a user