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 {
if (isEnumeratedAttr(key)) {
const v2CoercedValue =
value === null || value === false || value === 'false'
? 'false'
: value !== undefined
? 'true'
: null
value === undefined
? null
: value === null || value === false || value === 'false'
? 'false'
: 'true'
if (
v2CoercedValue &&
compatUtils.softAssertCompatEnabled(

View File

@ -500,11 +500,3 @@ 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>`)
})

View File

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