I am trying to use vue-native-websocket and the wss is dynamic because it needs an access token.
So I have this:
import VueNativeSock from 'vue-native-websocket';
Vue.use(VueNativeSock, this.monitor);
export default {
created() {
this.$options.sockets.onmessage = this.handleToggle;
},
data() {
return {
type: false
};
},
methods: {
handleToggle(data) {
const object = JSON.parse(data.data);
console.log(object);
this.status = object.data;
}
},
props: ['items', 'monitor']
};
As you can see, the prop monitor is passed but when it comes time to do Vue.use()... I get undefined. How do I pass a dynamic variable to a Vue use?