fix: 修复表单初始化触发change事件缺少的自定义参数
fix: select组件以api加载时将选项回写scheme,以便change事件调用
This commit is contained in:
@ -51,6 +51,7 @@
|
||||
const formRef = ref<FormInstance>();
|
||||
const formWrap = ref<HTMLElement>();
|
||||
const wrapWidth = ref(960);
|
||||
const formData = inject('formData', { noInject: true });
|
||||
|
||||
const propsRef = ref<Partial<FormProps>>({});
|
||||
|
||||
@ -437,8 +438,8 @@
|
||||
for (const eventKey in schema.componentProps['events']) {
|
||||
if (eventKey !== 'change') return;
|
||||
try {
|
||||
const event = new Function('schema', 'formModel', 'formActionType', `${schema.componentProps['events'][eventKey]}`);
|
||||
event(schema, formModel, formApi);
|
||||
const event = new Function('schema', 'formModel', 'formActionType', 'extParams', `${schema.componentProps['events'][eventKey]}`);
|
||||
event(schema, formModel, formApi, { formData });
|
||||
} catch (error) {
|
||||
console.log('error', error);
|
||||
notification.error({
|
||||
|
||||
@ -83,6 +83,7 @@
|
||||
const wrapWidth = ref(960);
|
||||
const propsRef = ref<Partial<FormProps>>({});
|
||||
const schemaRef = ref<Nullable<FormSchema[]>>(null);
|
||||
const formData = inject('formData', { noInject: true });
|
||||
|
||||
const getSchemas = computed<FormSchema[]>(() => {
|
||||
return (unref(getProps).schemas as any) || unref(schemaRef);
|
||||
@ -438,8 +439,8 @@
|
||||
for (const eventKey in schema.componentProps['events']) {
|
||||
if (eventKey !== 'change') return;
|
||||
try {
|
||||
const event = new Function('schema', 'formModel', 'formActionType', `${schema.componentProps['events'][eventKey]}`);
|
||||
event(schema, formModel, formApi);
|
||||
const event = new Function('schema', 'formModel', 'formActionType', 'extParams', `${schema.componentProps['events'][eventKey]}`);
|
||||
event(schema, formModel, formApi, { formData });
|
||||
} catch (error) {
|
||||
console.log('error', error);
|
||||
notification.error({
|
||||
|
||||
Reference in New Issue
Block a user