其他分享
首页 > 其他分享> > pc端微信打开订阅消息之事件对象e

pc端微信打开订阅消息之事件对象e

作者:互联网

用户在pc端微信中的订阅消息中打开评价消息,发现无法选中星级,

 

 点击下面的评价五角星,没有反应

 

 经查发现:

 mousedown(e) {
      console.log(e, 'mousedown====');
      // #ifdef H5
      if (!this.IsPC()) return;
      if (this.readonly || this.disabled) return;
      const { clientX } = e;
      let offsetLeft;
      if (e.currentTarget && e.currentTarget.offsetLeft) { // 模版消息打开的评价没有e.clientX
        offsetLeft = e.currentTarget.offsetLeft;
      }
      this.userLastRate = this.valueSync;
      this._getRateCount(clientX, offsetLeft);
      this.userRated = true;
      // #endif
    },

  

 const { clientX } = e;中并没有clientX, 而是这样的

 

 而此处的clienX需要使用  e.currentTarget.offsetLeft

 

 

标签:clientX,订阅,return,微信,pc,offsetLeft,currentTarget,mousedown
来源: https://www.cnblogs.com/scuplting-in-time/p/15692037.html