Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: form component events bind #5137

Merged
merged 3 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
mynetfan marked this conversation as resolved.
Show resolved Hide resolved
emptyStateValue = undefined,
} = (config || {}) as FormCommonConfig;

Expand Down
Loading