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
  1. open browser navigate http://localhost:8080
  2. 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

image

dom structure is

image

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)

Most upvoted comments

+1 Still in 2017