Skip to content

rerender vs reload #41

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

Open
jjrv opened this issue Nov 5, 2016 · 1 comment
Open

rerender vs reload #41

jjrv opened this issue Nov 5, 2016 · 1 comment

Comments

@jjrv
Copy link

jjrv commented Nov 5, 2016

I'm trying to get vue-hot-reload-api working with SystemJS instead of Webpack. Currently if I call api.reload, it doesn't seem to re-render the component, at least if only the render function has changed. Instead it only re-renders the parent, not the changed component. Is this correct? vue-loader seems to only ever call reload though.

Should I call both reload and rerender to make sure the component updates completely?

I'm modifying a component App mounted like this:

new Vue({
	el: '#app',
	components: { App },
	render: (h) => h('app')
});

When this API calls instance.$parent.$forceUpdate() here, it seems to decide here that it got back the same vnode as earlier and doesn't render it again.

@Toilal
Copy link

Toilal commented Mar 17, 2017

Maybe you need to delete the _Ctor property from component options object. It seems to be a cache that keeps previous data even when calling reload. (see https://github.com/vuejs/vue-loader/blob/1d63e9ec610490767b447cee5cf53e00faf905fa/lib/loader.js#L443 as an example)

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

2 participants