ecahrts网络请求之后数据不更新

由于ecahrts是一个组件 所以需要在这个组件进行监听一下 传来的数据

  props: {
    
    
    dataValue: {
    
    
      type: Number,
      default: 0,
    },
    dataName: {
    
    
      type: String,
      default: "出勤率",
    },
  },
  watch: {
    
    
    dataValue: {
    
    
      handler(newData) {
    
    
        console.log("子", newData);
        this.init()
      },
      // 立即监听
      immediate: true,
      // 深度监听
      deep: true,
    },
  },

猜你喜欢

转载自blog.csdn.net/qq_38594056/article/details/117250694