1
은 내가 데이터를 처리 엔드를 백업하고 그 결과를 반환하는 $http.get
전화를 걸, 나는 (속성이 데이터 목록에 선언 된) 동적 this
에 속성을 할당 할 :
watch: {
send_amount: function() {
this.updateAmount('my_param1');
},
receive_amount: function() {
this.updateAmount('my_param2');
},
},
methods: {
updateAmount: function(_par) {
var vVar = this;
this.$http.get('http://www.website.dev/api/calculate', { params: { rec: _par } })
.then(function(response) {
_results = JSON.parse(response.data);
$.each(_results, function(k, v) {
vVar[k] = v; // << this causes the $http.get request to be sent over and over, infinitely.
});
});
}
}
을 보고있는 변수를 업데이트하여 만난 경우 다시 불려지는 hod. – Nit
그게 문제가 된 것 같습니다. 둘 중 하나가 클라이언트에 의해 업데이트되고 다른 하나가 프로그래밍 방식으로 업데이트 될 때 내가보고있는 두 개의 입력이 있습니다. 그것을 설명하기 위해 코드를 업데이트했습니다. 그렇다면 프로그래밍 방식으로 업데이트 할 때 업데이트하지 않도록주의해야합니까? – qwaz