You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to separate onopen events for each vue component. Now I see alerts with 1 and 2 two times.
Is there a way to avoid this duplication?
Vue.use(VueNativeSock.default, wsPath, {
reconnection: true,
reconnectionAttempts: 5,
reconnectionDelay: 3000,
format: 'json',
});
var app1 = new Vue({
created: function () {
var vm = this;
this.$options.sockets.onmessage = function (message) {
vm.listen(message);
};
this.$options.sockets.onopen = function () {
alert(1);
}
}
});
var app1 = new Vue({
created: function () {
var vm = this;
this.$options.sockets.onmessage = function (message) {
vm.listen(message);
};
this.$options.sockets.onopen = function () {
alert(2);
}
}
});
The text was updated successfully, but these errors were encountered:
I want to separate onopen events for each vue component. Now I see alerts with 1 and 2 two times.
Is there a way to avoid this duplication?
The text was updated successfully, but these errors were encountered: