Vue 响应式属性问题
<html>
<head>
<meta charset=”utf-8″ />
<title>货单详情</title>
</head>
<body>
<div id=”app”>
<div id=”main”>
{{waybill.qwert}}
</div>
</div>
</body>
<script src=”~/js/[email protected]/dist/vue.js”></script>
<script src=”~/js/[email protected]/dist/axios.js”></script>
<script>
var app = new Vue({
el: ‘#app’,
data: function () {
return {
waybill: {
},
}
},
methods: {
doQuery:function () {
axios.post(“@Url.Content(“~/Waybill/GetWaybillInfo”)”, { waybill_id: 26 })
.then(response => {
this.waybill = response.data.waybill;
this.waybill.qwert = “aa1”;
});
//this.waybill.qwert = “aa2”;
},
},
mounted() {
this.doQuery();
}
})
</script>
</html>
===================================================================
按照我的理解 qwert 属性不是响应性属性,我在 chrome 调试看过也是没有 getter 和 setter 的,所以逻辑上说,qwert 不应该在页面上有显示,但事实却相反,显示 aa1.
请问各位大神,我的理解哪里不对?