vue-hot-reload-api icon indicating copy to clipboard operation
vue-hot-reload-api copied to clipboard

rerender vs reload

Open jjrv opened this issue 9 years ago • 1 comments
trafficstars

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.

jjrv avatar Nov 05 '16 08:11 jjrv

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)

Toilal avatar Mar 17 '17 15:03 Toilal