Open gutisalex opened 4 years ago
Hey, @gutisalex Could you please show me entire action? TypeScript doesn't always transpile actions the way you expect.
I suppose you use arrow function which doesn't have this
I had the same problem using class components in nuxt.
This happens when you use this
because referencing the class and not the entire document.
The solution that worked for me was to directly access the prototype of vue
you should have something like this
Vue.prototype.$socket.client.emit ('Some Data', data);
Using vuex-class-component with typescript I get an error trying to dispatch an action and commiting an event the way it is described in the docs:
Code:
this._vm.$socket.client.emit('SomeEvent', data);
Error:
any Property '_vm' does not exist on type 'MyModule'.ts(2339)
Any idea?