0👍
actions is outside of the function scope. you need to bind manually or use ES6 arrow functions to avoid undefined.
0👍
Ok this is me overthinking the problem.
In Vue, when passing this
to an external function, Vue doesn’t treat it as {state, actions}
like React.
The argument (which in my case is this
) should be used in the same way as it is used inside the component itself. Calling methods by this.myMethod()
I changed the argument from {state, actions}
-> actions
at it all worked.
Thanks for the pointers!
- [Vuejs]-Why does my Vue.js app not run when I use the runtime version of Vue?
- [Vuejs]-Button class removal doesn't render immediately
Source:stackexchange.com