export default{ data(){ return{} }, watch:{ "$route":"getPath" // 监听事件 }, methods:{ getPath(){ let path = this.$rount.path; //或得当前路径 进行逻辑判断 } } }