[Vuejs]-Accessing _this

0👍

can you try using this and bind? So something like

items: object[] = [
    {
        title: test,
        onclick: this.doSomething.bind(this);
    }
]

Basically we are telling the onclick handler to not change the context of this to the individual objects, but to keep it as the container context.

Leave a comment