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:
- if you want to update vuex, make a callback for each object value change.
- every time you want to call a method of
Server
object on vuex, let theServer
object and the member invuex
do a mapping, so that the member rendered byvuex
can correspond to the corresponding object on the interface and call its method .
is there a better way to deal with objects and vuex
?