浏览代码

fix: this指向问题

cuiyalong 1 年之前
父节点
当前提交
4fe4469b14
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      data/data-models/modules/quick-monitor/plugins/base.js

+ 1 - 1
data/data-models/modules/quick-monitor/plugins/base.js

@@ -33,7 +33,7 @@ class MonitorApiBase {
       data: {}
     }
 
-    const doAction = follow ? this.ajaxRemove : this.ajaxAdd
+    const doAction = follow ? this.ajaxRemove.bind(this) : this.ajaxAdd.bind(this)
     result = await doAction()
     if (result.success) {
       this.model.follow = !follow