No longer works in @vue/composition-api v0.5.0
delaneyj opened this issue · 3 comments
delaneyj commented
export default defineComponent({
setup() {
const state = ref('hello world')
const root = ref(null)
watch(root, () => console.log(root.value))
return () => <h1 ref={root}>{state.value}</h1>
},
})
willl always print null
to the console.
joaomede commented
Currently, "createElement" has been renamed to "defineComponent" in "@vue/composition-api", the preset imports "createElement" as "h" and removing the "this.$createElement" from the component, as "createElement" can no longer be imported, the preset is broken. one of the solutions would be to replace "this.$createElement" with "const h = ctx.root.$createElement", but I don't know if it will work.
luwanquan commented
Fixed, see v0.3.6