instance.$on is not a function
时间: 2024-01-10 22:02:17 浏览: 23
This error message usually occurs when you are trying to call the `$on` method on an object that does not have that method defined.
In Vue.js, the `$on` method is used to register an event listener on a component instance. If you are getting this error, it could be because:
1. The object you are calling `$on` on is not a Vue.js component instance.
2. The Vue.js instance has not been properly initialized or mounted before calling `$on`.
3. The Vue.js version you are using may not support the `$on` method.
To fix this error, make sure that you are calling `$on` on a valid Vue.js component instance, and that the instance has been properly initialized and mounted. You can also try using a different version of Vue.js that supports the `$on` method.