Browse Source

fix: this指向问题

cuiyalong 1 year ago
parent
commit
4fe4469b14
1 changed files with 1 additions and 1 deletions
  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: {}
       data: {}
     }
     }
 
 
-    const doAction = follow ? this.ajaxRemove : this.ajaxAdd
+    const doAction = follow ? this.ajaxRemove.bind(this) : this.ajaxAdd.bind(this)
     result = await doAction()
     result = await doAction()
     if (result.success) {
     if (result.success) {
       this.model.follow = !follow
       this.model.follow = !follow