Home > front end >  For help in electron - vue, must receive the udp data in real time, parsed, and real-time rendering
For help in electron - vue, must receive the udp data in real time, parsed, and real-time rendering

Time:09-17

This is the ordinary vue receive udp data interface, can run normally, but I go to other page, we won't be able to obtain a data,

This is to try to write vuex below, but can only be run once, how can have been monitored the udp data?

Thank you thank you, welcome advice,

CodePudding user response:

Can when initializing the Vue value to establish a socket connection and then commit to the vuex a field, the page on this field is required only is ok, if there is a push the same data can be written a count record data is the first visit

CodePudding user response:

If you only need to push the data in the current page
The methods
The callback (MSG) {
//processing data
}
Mounted
Enclosing iniudp (enclosing the callback)

Vuex
Inside onmessgae callback (MSG)