const root = document.createElement('div')
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>')
})
})
}),
).render()
- // foo has higher priority than bindObj.foo
- expect(props).toEqual({ foo: 0, baz: 'qux' })
+ expect(props).toEqual({ foo: 100, baz: 'qux' })
foo.value = 2
await nextTick()
+ expect(props).toEqual({ foo: 100, baz: 'qux' })
+
+ delete bindObj.value.foo
+ await nextTick()
expect(props).toEqual({ foo: 2, baz: 'qux' })
})
if (key === '$') return
// need special merging behavior for class & style
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.$
if (dynamicSources) {
let i = dynamicSources.length
}
}
}
-
+ if (hasOwn(rawProps, key)) {
+ if (merged) {
+ merged.push(rawProps[key]())
+ } else {
+ return rawProps[key]()
+ }
+ }
if (merged && merged.length) {
return merged
}