core-vapor
core-vapor copied to clipboard
`createIf` doesn't update
createIf
only updates when passing a context ref.
const value = ref(true)
const Parent = {
render() {
return createComponent(Child)
},
}
const Child: Component = {
+ setup() {
+ return { value }
+ },
render(_ctx) {
return createIf(() => _ctx.value, template(`<div>`), template(`<span>`))
},
}
const { html, serialize } = define(Parent).render()
value.value = false
await nextTick()
console.log(html()) // Doesn't change when without setup