Recently used Select2 to do a next Lado, if just get a list from the back-end rendering Fortunately, there is no problem. However, there is a problem with Select2 to display the default options for selected when the data is initialized.
VMs. $set (' areas ', data.data); areaIdsSelect2 (); Areaidsselect2change ();
The zone does not show the default selected. Now make a timer,
VM. $set (' areas ', Data.data); SetTimeout (function () { areaIdsSelect2 (); Areaidsselect2change ();},1);
A 1-millisecond delay will work properly. The problem was analyzed for a long time and no answer was found. Now feel the need for threading mechanism and data binding in depth, this aspect needs to study Vuejs source code, now do not have the conditions to do this work, this problem is first written down, later study.
The problem of vue.js threading mechanism or the delay of data bidirectional binding