解决思路: export default { name: 'app', data () { return { showSide: true } }, components: { TopBar, SideBar }, methods: { }, watch: { '$route': function(val, oldVal){ /^\/stores/.test(val.path) ? this.showSide = false : this.showSide = true; } } } 该思路解决了路由跳转('/' --> '/stores')时对SideBar的隐藏。但有一个遗漏,直接访问路径('/stores')时无法隐藏SideBar,原因是直接访问该路径时,没有触发App的watch。据此做了点改进,加了一个created钩子。 export default { ... methods: { SideBarCtrl(path){ /^\/stores/.test(path) ? this.showSide = false : this.showSide = true; } }, created: function(){ this.SideBarCtrl(this.$route.path) }, watch: { '$route': function(val, oldVal){ this.SideBarCtrl(val.path); } } }