How does vuex manage dynamic objects?

I now have a page

each line contains an instance of the Server class, with pingTest method and ssTest method, and pingTestValue > attribute ssTestValue attribute
when I add a Server to Vuex , only name , ip , pingTestValue , < code If its value is changed by a non- commit , there will be warnings and errors.

so I added a pingValueCallback to the Server class to call commit of vuex to update pingValue in vuex , but there are two problems with this approach:

  1. if you want to update vuex, make a callback
  2. for each object value change.
  3. every time you want to call a method of Server object on vuex, let the Server object and the member in vuex do a mapping, so that the member rendered by vuex can correspond to the corresponding object on the interface and call its method
  4. .

is there a better way to deal with objects and vuex ?

May.10,2021
Menu