mirror of https://github.com/vuejs/core.git
Merge f006bad1a0
into 56be3dd4db
This commit is contained in:
commit
438e6214ae
|
@ -59,9 +59,9 @@ export function compatCoerceAttr(
|
||||||
): boolean {
|
): boolean {
|
||||||
if (isEnumeratedAttr(key)) {
|
if (isEnumeratedAttr(key)) {
|
||||||
const v2CoercedValue =
|
const v2CoercedValue =
|
||||||
value === null
|
value === null || value === false || value === 'false'
|
||||||
? 'false'
|
? 'false'
|
||||||
: typeof value !== 'boolean' && value !== undefined
|
: value !== undefined
|
||||||
? 'true'
|
? 'true'
|
||||||
: null
|
: null
|
||||||
if (
|
if (
|
||||||
|
|
|
@ -500,3 +500,11 @@ 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>`)
|
||||||
|
})
|
||||||
|
|
Loading…
Reference in New Issue