解决方法 一、使用watch属性监听route对象 watch: { $route(to, from) { if (this.$route.query.id && from.path == "/client/index"