vue-loader: vue-router subroutes has bug with vue-hot-module-replacement
demo: https://github.com/GilbertSun/vue-debug-demo
repeat: 1.
npm install && npm run dev
- open browser navigate
http://localhost:8080 - change
./src/index.vue
<template>
<div>
<header>i am header</header>
<main>
<router-view></router-view>
</main>
</div>
</template>
to
<template>
<div>
<header>i am header change</header>
<main>
<router-view></router-view>
</main>
</div>
</template>
it will apply hot module replacement
i got the result

dom structure is

it looks like hmr inject the whole app into a sub router-view
ps: i’m not sure this is a vue-loader bug, but in the https://github.com/vuejs/vue-router/tree/dev/example/advanced this bug didn’t appear, so i think this bug may the difference version in vue-loader or vue-hot-reload-api
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 10
- Comments: 22 (3 by maintainers)
+1 Still in 2017