| | |
| | | pageFlag: 0, |
| | | }; |
| | | }, |
| | | methods: { |
| | | checkPageFlag() { |
| | | let pageFlag = this.$route.query.pageFlag |
| | | ? Number(this.$route.query.pageFlag) |
| | | : 0; |
| | | console.log(pageFlag, "refresh???", this.pageFlag); |
| | | if (pageFlag !== this.pageFlag) { |
| | | console.log('refresh'); |
| | | this.refreshFN(); |
| | | this.pageFlag = pageFlag; |
| | | } |
| | | } |
| | | }, |
| | | beforeRouteEnter(to, from, next) { |
| | | next((vm) => { |
| | | // 由于页面跳转后,在跳转页面筛选后,切换页面后会自动恢复,因此跳转页面需要定义一个方法refreshFN 在里面定义需要执行的代码 |
| | | if (vm.refreshFN && "function" == typeof vm.refreshFN) { |
| | | // 新版本此处获取不到vm实例的响应属性 故改为在checkPageFlag中判断 |
| | | vm.checkPageFlag(); |
| | | // let pageFlag = vm.$route.query.pageFlag |
| | | // ? Number(vm.$route.query.pageFlag) |
| | | // : 0; |
| | |
| | | // vm.refreshFN(); |
| | | // // vm.pageFlag = pageFlag; |
| | | // } |
| | | // 新版本此处获取不到vm实例的响应属性 故改为在页面refreshFN中判断 |
| | | vm.refreshFN(); |
| | | } |
| | | |
| | | // 由于页面从非激活状态激活时 不会触发mounted 如果有需求需要定义一个方法 activeFN 在里面定义需要执行的代码 |
| | |
| | | // 如果有 则关闭websocket |
| | | if (this.WSClose && "function" == typeof this.WSClose) { |
| | | this.WSClose(); |
| | | } |
| | | // TODO |
| | | if (this.refreshFN && "function" == typeof this.refreshFN) { |
| | | let pageFlag = this.$route.query.pageFlag |
| | | ? Number(this.$route.query.pageFlag) |
| | | : 0; |
| | | console.log(pageFlag, 'deactive'); |
| | | // this.pageFlag = pageFlag; |
| | | } |
| | | }, |
| | | }; |