this.$emit not a function in component method
-
I was trying to call $emit in a method in an vue component file, but got this error. Can anyone out there give me a hand?
Here is my code:
methods: {
bz: function (load) {
debugger
this.$emit(‘read’, load)
}
} -
It looks like a scoping issue.
console.log(this)
and lok what it is referring to -
@a47ae I logged ‘this’, it is a VueComponent, but has no $emit method.
-
That’s really strange, it should be available on every VueComponent: https://vuejs.org/v2/api/#vm-emit
Is it only on this component or also on others?
-
@a47ae Really weird.I use quasar 0.15.12.