fix(compiler-core): only merge true handlers (#4577)

This commit is contained in:
Herrington Darkholme 2021-09-22 00:37:51 +08:00 committed by GitHub
parent f31a6c105d
commit d8a36d0198
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -807,7 +807,7 @@ function dedupeProperties(properties: Property[]): Property[] {
const name = prop.key.content
const existing = knownProps.get(name)
if (existing) {
if (name === 'style' || name === 'class' || name.startsWith('on')) {
if (name === 'style' || name === 'class' || isOn(name)) {
mergeAsArray(existing, prop)
}
// unexpected duplicate, should have emitted error during parse