{ message: "Hello how are you", status: false, state: Kerala }
以下の値は、AJAXリクエストの応答です。応答が変わるたびに。私はVue.jsを使ってそれを印刷する必要がありますか?Vue.jsを使ってこれを表示するには?
<script>
regBox = new Vue({
el: "#regBox",
data: {
username : '',
},
methods: {
handelSubmit: function(e) {
data = {};
data['username'] = this.username;
$.ajax({
url: 'https://herokuapp.com/api/user/box/',
data: data,
type: "POST",
dataType: 'json',
success: function(e) {
if (e.status) {
alert(" Success")
} else {
alert("failed");
}
}
});
return false;
}
},
});
</script>
たぶん、この問題のコメントデモが参考になります。https://stackoverflow.com/questions/46927074/what-causes-vuejs-このインスタンスではdom-in-this-instanceを更新する – WaldemarIce
私は同じアイデアを得ていませんでした – Wanderer