【发布时间】:2018-05-01 07:49:50
【问题描述】:
这是我的回复.. 如何显示错误信息?密码不匹配
{"errors": {"password": ["Passwords donot match"]}, "status": false, "msg": "Validation erro", "error-type": 0}
目前我的代码是
<script>
regBox = new Vue({
el: "#regBox",
data: {
..........
response: {
message: '',
status: '',
state: '',
errors: '',
}
},
methods: {
handelSubmit: function(e) {
var vm = this;
data = {};
..............
$.ajax({
url: '',
data: data,
type: "POST",
dataType: 'json',
success: function(e) {
if (e.status)
{
alert(" Success")
}
else {
vm.response = e;
alert(" Failed")
}
}
});
return false;
}
},
});
</script>
我的显示相同的html代码是
<p class="error">{{response.errors.password}}</p>
目前我收到错误消息 [“密码不匹配”]
如何只获取消息
密码不匹配..那么,我怎么能得到它..谁能帮忙
【问题讨论】:
标签: javascript jquery vue.js vue-component