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(element): fix Radio.Group Checkbox.Group warning #3986 #4003

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { h } from '@formily/vue'
import { isVue2, defineComponent } from 'vue-demi'

type ListenersTransformRules = Record<string, string>
const noop = () => {}

export const transformComponent = <T extends Record<string, any>>(
tag: any,
Expand All @@ -27,7 +28,7 @@ export const transformComponent = <T extends Record<string, any>>(
const transformListeners = transformRules
Object.keys(transformListeners).forEach((extract) => {
if (data.on !== undefined) {
data.on[transformListeners[extract]] = listeners[extract]
data.on[transformListeners[extract]] = listeners[extract] || noop
}
})
}
Expand All @@ -51,7 +52,7 @@ export const transformComponent = <T extends Record<string, any>>(
Object.keys(listeners).forEach((extract) => {
const event = listeners[extract]
data[`on${event[0].toUpperCase()}${event.slice(1)}`] =
attrs[`on${extract[0].toUpperCase()}${extract.slice(1)}`]
attrs[`on${extract[0].toUpperCase()}${extract.slice(1)}`] || noop
})
}
if (defaultProps) {
Expand Down
Loading