假设我正在使用Vue.js构建一个web应用程序,其中终端用户使用表单订阅时事通讯。前端是一个Vue应用程序,后端是一个PHP。
API需要基本的Auth身份验证。
在前面,我使用axios调用API:
axios
.post('localhost/api/v1/subscriber.php', {
// I know the data is missing but this is not what the question is about..
auth: {
username: 'USER',
我是vue.js新手,这就是我用vue.js提交表单的方式,但是表单没有提交,我得到了"?“在提交表单之后,也可以在URL中找到。
<!-- root Element -->
<body id="test">
<!-- My html form -->
<form v-on="submit: send">
<input>
<button>Send</button>
</form>
<script src="https://cdnj
描述- vue.js web表单验证场景
使用的vue-form验证器库来自。
jsfiddle链接:
问题:
在使用dom的form.reset()方法时,无法在没有错误类的情况下将表单重置到状态。在ajax提交之后,处理重置表单的正确方法是什么?当你点击“重置”按钮时,如何在没有验证文本的情况下恢复到init状态& css高亮显示?
在jsfiddle示例中,浏览器控制台调试模式。
- since one of the condition to remove error class is to make $submitted value to false, yet