Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer works in @vue/composition-api v0.5.0 #11

Closed
delaneyj opened this issue Jun 12, 2020 · 3 comments
Closed

No longer works in @vue/composition-api v0.5.0 #11

delaneyj opened this issue Jun 12, 2020 · 3 comments

Comments

@delaneyj
Copy link

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
Copy link

joaomede commented Jul 5, 2020

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.

@antfu
Copy link

antfu commented Jul 5, 2020

#12

@luwanquan
Copy link
Owner

Fixed, see v0.3.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants