beforeRouteEnter不能直接this.$store,可采用下面的方式
beforeRouteEnter(to, from, next) { const store = from.matched[0].instances.default.$store next() }
[转自]:https://github.com/vuejs/vue-router/issues/1103