<input type="text" id="username" style="position
ixed;bottom:-9999px" />
<input type="password" id="password" style="position
ixed;bottom:-9999px" />
<el-form-item v-show="!formData.SmsLogin">
<el-input v-model.trim="formData.Account" autocomplete="off" placeholder="用户名/邮箱/手机号" maxlength="50" v-validate="{data
ormData.Account,dataType:'*',nullMsg:'请填写登录账号',ignore
ormData.SmsLogin==1}"></el-input>
<span class="help-block validate-tips-box"></span>
</el-form-item>
<el-form-item v-show="!formData.SmsLogin">
<el-input type="password" v-model.trim="formData.Password" autocomplete="off" placeholder="登录密码" maxlength="50" v-validate="{data
ormData.Password,dataType:'password',nullMsg:'请填写登录密码',ignore
ormData.SmsLogin==1}"></el-input>
<span class="help-block validate-tips-box"></span>
</el-form-item>
html中加上id, js也写了
var userID = document.getElementById("username");
var passWD = document.getElementById("password");
var s_form = document.getElementById("loginForm");
userID.setAttribute("value",userName);
passWD.setAttribute("value",Password);
看见输入框中有用户名和密码填上,点登录按钮,显示用户名和密码没有输入,这是为什么呢?