[vue] Change the data of the vue field, but the view is not updated

The situation encountered is that when the background is passed to the foreground, the entire value is directly assigned, and another data is added, but the newly added data is not displayed, and the view is not updated

Original:

vm.menu = r.data;
vm.menu.gateWayName=null;

After modification:

            $.get("../info/" + id, function (r) {
                vm.showList = false;
                vm.title = "修改";

                var dataItem=r.data;
                vm.menu.routeRuleid=dataItem.routeRuleid;
                vm.menu.gateWayName=null;
            });

 

Guess you like

Origin blog.csdn.net/mudarn/article/details/106716622