watch: {//监听路由变化 $route(to,from){ if(!(this.$route.params && this.$route.params.id)) { this.courseInfo = {} //清空 } } },