vue back-end data acquisition can not be two-way data binding

Recently, a product was added / demand shelves, with an element-UI's <switech> assembly which is similar to a sliding switch left, bound to a default attribute check

Get when the page is loaded with a whole array object list, and then v-for rendering backend is to determine whether the product was added to state the basis for the status property, determination of the status of the list I will get cycle, then add a check for each object attribute

But found that, when bound to the <switch> assembly checked = 'item.checked' time, can not change the attributes clicking

The problem is: Attribute data are not declared (even get up from the back end to the assignment data) can not be two-way data binding

The solution is: After clicking the <switch> when a request to be sent, the back-end change in the state, after the re-data request is complete click on the visual data on the effect of the change

Guess you like

Origin www.cnblogs.com/hurenjie/p/12014954.html