回车触发事件,比如登录页面输入密码后回车触发登录功能。

关键代码:

 @keyup.enter.native="accountLogin()" 

示例代码:

 <el-form-item label="密码" prop="password" class="clearTag" style="position: relative;">
    <el-input v-model="loginForm.password" type="password"     
       @keyup.enter.native="accountLogin()">
    </el-input>
    <el-button type="text" style="float: right; position: absolute; right: 0; bottom: 
       -40px; color: #C0C0C0;" @click="getPassword()">忘记密码?
     </el-button>
 </el-form-item>

Logo

前往低代码交流专区

更多推荐