Open dbrezoev opened 8 years ago
In custom VM declare method:
export default class MyVMUsingGrid {
doSmth(item) {
}
}
In ViewModel - my-vm-using-grid.html
grid...
grid-row
grid-col
button(click.trigger="doSmth($item)"
By default you have access to viewmodel's scope.
button(click.trigger="$item.parent.doSmth($item)"
- we did this in order to reachdoSmth
method from the view model. So every $item has parent property in it.If
doSmth
method is declared like this:doSmth = (params) => { do smth }
you can access it with:button(click.trigger="parent.doSmth($item)"