Akryum / vue-router-multi-view

router-view meet v-show meet keep-alive
https://akryum.github.io/vue-router-multi-view/
86 stars 9 forks source link

activated / deactivated functions are triggered much time when changing route #35

Open phamtuanit opened 4 years ago

phamtuanit commented 4 years ago

Hi there,

Thank you for good repo. Now I have an error like above title. When I change route, activated / deactivated hooks will be called many times.

activated() {
        console.log("---> activated", this.$attrs["data-route-name"]);
    },
deactivated() {
        console.log("<--- deactivated", this.$attrs["data-route-name"]);
    },

Below is logs when switching from 'app-chat' to 'app-channel'

16:09:37.454 index.vue:79 <--- deactivated app-chat
16:09:37.455 index.vue:71 ---> activated app-chat
16:09:37.456 index.vue:79 <--- deactivated app-chat

16:09:37.458 index.vue:72 ---> activated app-channel
16:09:37.459 index.vue:80 <--- deactivated app-channel
16:09:37.461 index.vue:72 ---> activated app-channel

Could you help me?

ghost commented 4 years ago

@Akryum This makes the plugin unusable, unfortunately