- 在密码输入框加入事件:@keyup.enter.native
- 登录button加入事件:@click
代码:
pug 语法:
el-form(ref="loginForm" :model="loginForm" :rules="rules" label-width="78px" label-position="left" inline)
el-form-item(label='用户名:' prop="username")
el-input(v-model="loginForm.username" placeholder="请输入用户名")
el-form-item(label='密码:' prop="passwd")
el-input(type="password" placeholder="请输入密码" v-model="loginForm.passwd" @keyup.enter.native="loginFn('loginForm')")
el-form-item(label=' ')
el-button(type="primary" class="submit_btn" @click="loginFn('loginForm')") 登录