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

rerender throws an exception when component options are missing a render function #84

Open
BrightSoul opened this issue Nov 8, 2020 · 0 comments

Comments

@BrightSoul
Copy link

BrightSoul commented Nov 8, 2020

Hi everyone, I'm having an issue with rerender.

In the readme.md file, you provided a sample component options.

const myComponentOptions = {
  data () { ... },
  created () { ... },
  render () { ... }
}

However, my object does not have a render function. It's using a template, instead. Here's a sample:

const componentOptions = {
  data() { return { foo: 'bar' }; },
  template: '<div>foo value is: {{ foo }}</div>'
};

When I try to rerender it, an exception occurs because the render function is missing.

vue-rerender

The reload method is working perfectly fine though.

Here's a repro:
https://github.com/BrightSoul/vue-hot-reload-api-issue-repro

I am aware that an easy solution to this is to just rewrite my component options like this:

const componentOptions = {
  data() { return { foo: 'bar' }; },
  ...Vue.compile('<div>foo value is: {{ foo }}</div>')
};

But I was wondering whether the difference in behavior between reload and rerender is intended or not.

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

1 participant