feat: listen form field value change

This commit is contained in:
chengj 2022-04-13 10:49:53 +08:00
parent b0a0cbcd6a
commit c0441cf5c3
1 changed files with 2 additions and 1 deletions

View File

@ -66,7 +66,7 @@
name: 'BasicForm',
components: { FormItem, Form, Row, FormAction },
props: basicProps,
emits: ['advanced-change', 'reset', 'submit', 'register'],
emits: ['advanced-change', 'reset', 'submit', 'register', 'field-value-change'],
setup(props, { emit, attrs }) {
const formModel = reactive<Recordable>({});
const modalFn = useModalContext();
@ -235,6 +235,7 @@
if (!validateTrigger || validateTrigger === 'change') {
validateFields([key]).catch((_) => {});
}
emit('field-value-change', key, value);
}
function handleEnterPress(e: KeyboardEvent) {