This commit is contained in:
yangxiuxiu 2025-05-05 20:38:42 +00:00 committed by GitHub
commit 438e6214ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -59,9 +59,9 @@ export function compatCoerceAttr(
): boolean {
if (isEnumeratedAttr(key)) {
const v2CoercedValue =
value === null
value === null || value === false || value === 'false'
? 'false'
: typeof value !== 'boolean' && value !== undefined
: value !== undefined
? 'true'
: null
if (

View File

@ -500,3 +500,11 @@ test('local app config should not affect other local apps in v3 mode', () => {
const app2 = createApp({})
expect(app2.config.globalProperties.test).toBe(undefined)
})
test('ATTR_ENUMERATED_COERCION: true', () => {
const vm = new Vue({
compatConfig: { ATTR_ENUMERATED_COERCION: true },
template: `<div><div draggable="false">hello</div></div>`,
}).$mount()
expect(vm.$el.innerHTML).toBe(`<div draggable="false">hello</div>`)
})