fix: form component events bind (#5137)
* fix: from component events bind * chore: update docs * chore: default value and docs syncdev-v5
parent
0410f1e1be
commit
698daf46c7
|
@ -14,8 +14,6 @@ setupVbenForm<ComponentType>({
|
|||
Upload: 'fileList',
|
||||
CheckboxGroup: 'model-value',
|
||||
},
|
||||
// select等组件的筛选功能会抛出input事件,需要禁用表单的input事件监听以免错误地更新了组件值
|
||||
disabledOnInputListener: true,
|
||||
},
|
||||
defineRules: {
|
||||
required: (value, _params, ctx) => {
|
||||
|
|
|
@ -10,8 +10,6 @@ import { $t } from '@vben/locales';
|
|||
|
||||
setupVbenForm<ComponentType>({
|
||||
config: {
|
||||
// naive-ui组件不接受onChang事件,所以需要禁用
|
||||
disabledOnChangeListener: true,
|
||||
// naive-ui组件的空值为null,不能是undefined,否则重置表单时不生效
|
||||
emptyStateValue: null,
|
||||
baseModelPropName: 'value',
|
||||
|
|
|
@ -14,8 +14,6 @@ initComponentAdapter();
|
|||
setupVbenForm<ComponentType>({
|
||||
config: {
|
||||
baseModelPropName: 'value',
|
||||
// naive-ui组件不接受onChang事件,所以需要禁用
|
||||
disabledOnChangeListener: true,
|
||||
// naive-ui组件的空值为null,不能是undefined,否则重置表单时不生效
|
||||
emptyStateValue: null,
|
||||
modelPropNameMap: {
|
||||
|
|
|
@ -45,8 +45,8 @@ export function setupVbenForm<
|
|||
const { config, defineRules } = options;
|
||||
|
||||
const {
|
||||
disabledOnChangeListener = false,
|
||||
disabledOnInputListener = false,
|
||||
disabledOnChangeListener = true,
|
||||
disabledOnInputListener = true,
|
||||
emptyStateValue = undefined,
|
||||
} = (config || {}) as FormCommonConfig;
|
||||
|
||||
|
|
|
@ -89,8 +89,8 @@ const computedSchema = computed(
|
|||
componentProps = {},
|
||||
controlClass = '',
|
||||
disabled,
|
||||
disabledOnChangeListener = false,
|
||||
disabledOnInputListener = false,
|
||||
disabledOnChangeListener = true,
|
||||
disabledOnInputListener = true,
|
||||
emptyStateValue = undefined,
|
||||
formFieldProps = {},
|
||||
formItemClass = '',
|
||||
|
|
|
@ -151,12 +151,12 @@ export interface FormCommonConfig {
|
|||
disabled?: boolean;
|
||||
/**
|
||||
* 是否禁用所有表单项的change事件监听
|
||||
* @default false
|
||||
* @default true
|
||||
*/
|
||||
disabledOnChangeListener?: boolean;
|
||||
/**
|
||||
* 是否禁用所有表单项的input事件监听
|
||||
* @default false
|
||||
* @default true
|
||||
*/
|
||||
disabledOnInputListener?: boolean;
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue