| | |
| | | } |
| | | } |
| | | }, |
| | | watch: {}, |
| | | mounted() {}, |
| | | computed: { |
| | | socketValue() { |
| | | return this.$store.state.socketValue; |
| | | } |
| | | }, |
| | | watch: { |
| | | socketValue() { |
| | | console.log(this.socketValue); |
| | | let that = this; |
| | | if (that.socketValue.type === "start") { |
| | | console.log("任务开启") |
| | | this.$store.commit("addTask", this.socketValue.rid); |
| | | } else if (that.socketValue.type === "stop") { |
| | | console.log("任务结束") |
| | | this.$store.commit("stopTask", this.socketValue.rid); |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$store.dispatch("connectws"); |
| | | }, |
| | | onLaunch: function() { //初始化完成时触发(全局只触发一次) |
| | | console.log('第一次进入') |
| | | // Window.say = Window.console; |