0👍
You can pass the component instance to your function as an argument
// component
created() {
...
addMarker(this, doc.id, doc.data())
...
}
// external function
function addMarker(vm, id, data) {
...
vm.markers.push(m)
...
}
- [Vuejs]-How to convert Vue classess to React classess?
- [Vuejs]-How Nuxtjs auth module works exactly?
Source:stackexchange.com