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

Vue.extend not works with render fn in setup #194

Closed
NikitaIT opened this issue Nov 20, 2019 · 3 comments
Closed

Vue.extend not works with render fn in setup #194

NikitaIT opened this issue Nov 20, 2019 · 3 comments

Comments

@NikitaIT
Copy link

NikitaIT commented Nov 20, 2019

const Comp = Vue.extend({
  setup() {
    const a = ref(1);
    return {
      a
    };
  },
  render() {
    return <div>{(this as any).a.value}</div>
  }
});
const vm = (new Comp()).$mount(); // ok
const Comp = Vue.extend({
  setup() {
    const a = ref(1);
   return () => <div>{a.value}</div>
  },
});
const vm = (new Comp()).$mount(); // [Vue warn]: Failed to mount component: template or render function not defined.

#151
#38

workaround

const Comp = Vue.bind(null,{
  setup() {
    const a = ref(1);
   return () => <div>{a.value}</div>
  },
});
const vm = (new Comp()).$mount(); // ok
@NikitaIT NikitaIT changed the title Vue.extend not mounted. deleted Nov 20, 2019
@NikitaIT NikitaIT reopened this Nov 20, 2019
@NikitaIT NikitaIT changed the title deleted Vue.extend not works with render fn in setup Nov 20, 2019
@xmsz
Copy link

xmsz commented Apr 23, 2020

any update?

@LinusBorg
Copy link
Member

No.

@pikax
Copy link
Member

pikax commented Jun 16, 2020

Fixed on #383

@pikax pikax closed this as completed Jun 16, 2020
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