Computed property was assigned to but it has no setter Question Notes

Initial code: popup window uses dialogtablvisible

 But other places change this value

 The value of this attribute is modified in methods

When this event occurs, this error will be reported Computed property was assigned to but it has no setter

The solution is actually very simple. The computed attribute defined in the component lacks a setter. Anyone who has used computed should know that this error message usually occurs when assigning a value to the computed attribute in the component. If there is no declared setter displayed, the console will print the above mistake. Then think in this direction, first of all, you can add a setter attribute in computed, but after adding it, an error will still be reported, because dialogtablvisible is not a value modified in computed. At this point, I think of another way to get the value of vuex:

At this point the problem has been resolved

Guess you like

Origin blog.csdn.net/guojixin12/article/details/130502356