Skip to content

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

@BrightSoul

Description

@BrightSoul

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions