mirror of https://github.com/vuejs/core.git
chore: update
This commit is contained in:
parent
2a5894730d
commit
c67368a52f
|
@ -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(
|
||||||
|
|
|
@ -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>`)
|
|
||||||
})
|
|
||||||
|
|
|
@ -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>`)
|
||||||
|
})
|
||||||
|
|
Loading…
Reference in New Issue