Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should work with textarea', async () => {
const component = defineComponent({
data() {
return { value: null }
},
render() {
return [
withVModel(
h('textarea', {
'onUpdate:modelValue': setValue.bind(this)
}),
this.value
)
]
}
})
app.mount(component, root)
count.value++
click()
}
return () =>
h(Child, {
foo: 1,
id: 'test',
class: 'c' + count.value,
style: { color: count.value ? 'red' : 'green' },
onClick: inc
})
}
}
const Child = defineComponent({
props: {
foo: Number
},
setup(props) {
onUpdated(childUpdated)
return () =>
h(
'div',
{
class: 'c2',
style: { fontWeight: 'bold' }
},
props.foo
)
}
})
id: 'test',
class: 'c' + count.value,
style: { color: count.value ? 'red' : 'green' },
onClick: inc
})
}
}
const Child = {
setup(props: any) {
onUpdated(childUpdated)
return () => h(GrandChild, props)
}
}
const GrandChild = defineComponent({
props: {
foo: Number
},
setup(props) {
onUpdated(grandChildUpdated)
return () =>
h(
'div',
{
class: 'c2',
style: { fontWeight: 'bold' }
},
props.foo
)
}
})