mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2026-05-15 04:54:12 +00:00
feat(form): 支持 TextConfig handler 返回 Promise,buttonClickHandler 改为 async await
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
2ad5101471
commit
54a5570419
@ -374,7 +374,7 @@ export interface TextConfig extends FormItem, Input {
|
||||
setModel: (prop: string, value: any) => void;
|
||||
setFormValue: (prop: string, value: any) => void;
|
||||
},
|
||||
) => void;
|
||||
) => void | Promise<void>;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -130,7 +130,7 @@ const inputHandler = (v: string) => {
|
||||
mForm?.$emit('field-input', props.prop, v);
|
||||
};
|
||||
|
||||
const buttonClickHandler = () => {
|
||||
const buttonClickHandler = async () => {
|
||||
if (!appendConfig.value) return;
|
||||
if (typeof appendConfig.value.handler === 'function') {
|
||||
const newChangeRecords: ChangeRecord[] = [];
|
||||
@ -142,7 +142,7 @@ const buttonClickHandler = () => {
|
||||
newChangeRecords.push({ propPath: key, value });
|
||||
};
|
||||
|
||||
appendConfig.value.handler(mForm, {
|
||||
await appendConfig.value.handler(mForm, {
|
||||
model: props.model,
|
||||
values: mForm ? readonly(mForm.initValues) : null,
|
||||
formValue: props.values || {},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user