mirror of https://github.com/vuejs/core.git
chore: tweaks
This commit is contained in:
parent
5f70576c73
commit
000d4d0e4e
|
@ -472,6 +472,6 @@ describe('attribute fallthrough', () => {
|
||||||
|
|
||||||
const root = document.createElement('div')
|
const root = document.createElement('div')
|
||||||
createApp(App).use(vaporInteropPlugin).mount(root)
|
createApp(App).use(vaporInteropPlugin).mount(root)
|
||||||
expect(root.innerHTML).toBe('<div foo="vapor foo" bar="bar"></div>')
|
expect(root.innerHTML).toBe('<div foo="foo" bar="bar"></div>')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -241,11 +241,14 @@ describe('component: slots', () => {
|
||||||
}),
|
}),
|
||||||
).render()
|
).render()
|
||||||
|
|
||||||
// foo has higher priority than bindObj.foo
|
expect(props).toEqual({ foo: 100, baz: 'qux' })
|
||||||
expect(props).toEqual({ foo: 0, baz: 'qux' })
|
|
||||||
|
|
||||||
foo.value = 2
|
foo.value = 2
|
||||||
await nextTick()
|
await nextTick()
|
||||||
|
expect(props).toEqual({ foo: 100, baz: 'qux' })
|
||||||
|
|
||||||
|
delete bindObj.value.foo
|
||||||
|
await nextTick()
|
||||||
expect(props).toEqual({ foo: 2, baz: 'qux' })
|
expect(props).toEqual({ foo: 2, baz: 'qux' })
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -178,16 +178,6 @@ export function getAttrFromRawProps(rawProps: RawProps, key: string): unknown {
|
||||||
if (key === '$') return
|
if (key === '$') return
|
||||||
// need special merging behavior for class & style
|
// need special merging behavior for class & style
|
||||||
const merged = key === 'class' || key === 'style' ? ([] as any[]) : undefined
|
const merged = key === 'class' || key === 'style' ? ([] as any[]) : undefined
|
||||||
|
|
||||||
// rawProps has high priority
|
|
||||||
if (hasOwn(rawProps, key)) {
|
|
||||||
if (merged) {
|
|
||||||
merged.push(rawProps[key]())
|
|
||||||
} else {
|
|
||||||
return rawProps[key]()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const dynamicSources = rawProps.$
|
const dynamicSources = rawProps.$
|
||||||
if (dynamicSources) {
|
if (dynamicSources) {
|
||||||
let i = dynamicSources.length
|
let i = dynamicSources.length
|
||||||
|
@ -206,7 +196,13 @@ export function getAttrFromRawProps(rawProps: RawProps, key: string): unknown {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (hasOwn(rawProps, key)) {
|
||||||
|
if (merged) {
|
||||||
|
merged.push(rawProps[key]())
|
||||||
|
} else {
|
||||||
|
return rawProps[key]()
|
||||||
|
}
|
||||||
|
}
|
||||||
if (merged && merged.length) {
|
if (merged && merged.length) {
|
||||||
return merged
|
return merged
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue