简体   繁体   中英

How to call vuejs function from javascript function?

在此处输入图片说明

How to call order function from successCallback ? The code is vuejs

Would be easier if the code you posted would be complete but my guess is:

Use arrow functions

var successCallback = payment_id => {
    // now "this" refers to this vue component instance so:
    this.order()
}

or store reference to this and use it like a variable

var that = this
var successCallback = function (payment_id) {
    // this is *this* function
    // "that" is a vue instance
    that.order()
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM