A
A
Alexey2017-12-22 20:10:48
Web development
Alexey, 2017-12-22 20:10:48

Why is the on event not firing on the vue component?

in the component I cling to the created hook, it emits normally. The server also accepts all the rules. Only now, when the server itself emits a message, the view does not want to accept it, as if it did not subscribe.
socket is defined globally, outside the vue instance

created: function() {
  socket.on('listfromserver',function(e) {
    alert('any data');
  });
  socket.emit('list','get');						
},

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vaultboy84, 2019-10-14
@Vaultboy84

Someone, shoot him...
But seriously, tell me the difference between responsive and adaptive in your view?
In order not to be considered a flood: bootstrap.

F
fh, 2017-12-23
@ramazan793

socket.emit('listfromserver','get');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question