How to call order function from successCallback ? The code is vuejs
asked Feb 5, 2020 at 11:43
Rushikesh
1171 gold badge3 silver badges13 bronze badges
1 Answer 1
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()
}
answered Feb 5, 2020 at 11:53
Michal Bieda
9396 silver badges13 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-js