Skip to content

Commit c67368a

Browse files
author
yangchangtao
committed
chore: update
1 parent 2a58947 commit c67368a

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

packages/runtime-dom/src/modules/attrs.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ export function compatCoerceAttr(
5959
): boolean {
6060
if (isEnumeratedAttr(key)) {
6161
const v2CoercedValue =
62-
value === null || value === false || value === 'false'
63-
? 'false'
64-
: value !== undefined
65-
? 'true'
66-
: null
62+
value === undefined
63+
? null
64+
: value === null || value === false || value === 'false'
65+
? 'false'
66+
: 'true'
6767
if (
6868
v2CoercedValue &&
6969
compatUtils.softAssertCompatEnabled(

packages/vue-compat/__tests__/global.spec.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -500,11 +500,3 @@ test('local app config should not affect other local apps in v3 mode', () => {
500500
const app2 = createApp({})
501501
expect(app2.config.globalProperties.test).toBe(undefined)
502502
})
503-
504-
test('ATTR_ENUMERATED_COERCION: true', () => {
505-
const vm = new Vue({
506-
compatConfig: { ATTR_ENUMERATED_COERCION: true },
507-
template: `<div><div draggable="false">hello</div></div>`,
508-
}).$mount()
509-
expect(vm.$el.innerHTML).toBe(`<div draggable="false">hello</div>`)
510-
})

packages/vue-compat/__tests__/misc.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,3 +275,11 @@ test('ATTR_ENUMERATED_COERCION', () => {
275275
)('contenteditable', 'foo', 'true'),
276276
).toHaveBeenWarned()
277277
})
278+
279+
test('ATTR_ENUMERATED_COERCION: true', () => {
280+
const vm = new Vue({
281+
compatConfig: { ATTR_ENUMERATED_COERCION: true },
282+
template: `<div><div draggable="false">hello</div></div>`,
283+
}).$mount()
284+
expect(vm.$el.innerHTML).toBe(`<div draggable="false">hello</div>`)
285+
})

0 commit comments

Comments
 (0)