expect(html()).toBe('foo')
})
+
+ test('should handle class prop when vapor renders vdom component', () => {
+ const VDomChild = defineComponent({
+ setup() {
+ return () => h('div', { class: 'foo' })
+ },
+ })
+
+ const VaporChild = defineVaporComponent({
+ setup() {
+ return createComponent(VDomChild as any, { class: () => 'bar' })
+ },
+ })
+
+ const { html } = define({
+ setup() {
+ return () => h(VaporChild as any)
+ },
+ }).render()
+
+ expect(html()).toBe('<div class="foo bar"></div>')
+ })
})
describe('v-model', () => {
const frag = new VaporFragment([])
const vnode = (frag.vnode = createVNode(
component,
- rawProps && new Proxy(rawProps, rawPropsProxyHandlers),
+ rawProps && extend({}, new Proxy(rawProps, rawPropsProxyHandlers)),
))
const wrapper = new VaporComponentInstance(
{ props: component.props },