Skip to content

Commit

Permalink
fix: from component events bind
Browse files Browse the repository at this point in the history
  • Loading branch information
mynetfan committed Dec 14, 2024
1 parent 0410f1e commit 3f6b9fc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 0 additions & 2 deletions apps/web-ele/src/adapter/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ setupVbenForm<ComponentType>({
Upload: 'fileList',
CheckboxGroup: 'model-value',
},
// select等组件的筛选功能会抛出input事件,需要禁用表单的input事件监听以免错误地更新了组件值
disabledOnInputListener: true,
},
defineRules: {
required: (value, _params, ctx) => {
Expand Down
2 changes: 0 additions & 2 deletions apps/web-naive/src/adapter/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions packages/@core/ui-kit/form-ui/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 3f6b9fc

Please sign in to comment.