liuyg
2022-02-21 bb04d82473b44a79e9b823ab2054ee79814098a2
App.vue
@@ -27,8 +27,27 @@
            }
         }
      },
      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;