chore: update

This commit is contained in:
yangchangtao 2025-05-27 17:41:59 +08:00
parent 2a5894730d
commit c67368a52f
3 changed files with 13 additions and 13 deletions

View File

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

View File

@ -500,11 +500,3 @@ test('local app config should not affect other local apps in v3 mode', () => {
const app2 = createApp({}) const app2 = createApp({})
expect(app2.config.globalProperties.test).toBe(undefined) 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>`)
})

View File

@ -275,3 +275,11 @@ test('ATTR_ENUMERATED_COERCION', () => {
)('contenteditable', 'foo', 'true'), )('contenteditable', 'foo', 'true'),
).toHaveBeenWarned() ).toHaveBeenWarned()
}) })
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>`)
})