将键盘按下操作放在el-form标签触发login方法
鼠标触发登录就放在button
<el-form :model="loginForm" :rules="rules" ref="loginRef" @keyup.enter="login">
<h2 class="title">请登录</h2>
<input class="form__input" type="text" placeholder="账号" v-model="loginForm.adname" />
<input class="form__input" type="password" placeholder="密码" v-model="loginForm.adpwd" />
<!-- 使用验证码组件 -->
<div style="display: flex;">
<el-form-item prop="code">
<el-input v-model="loginForm.code" style="width:212px; height:40px; margin-left: -30px; margin-top: 27px;" type="text" placeholder="请选择验证码" />
<div class="Sidentify" style="flex:1; height:36px" size="small" >
<Sidentify @input="getCode"></Sidentify>
</div>
</el-form-item>
</div>
<el-button class="primary-btn" @click="login">立即登录</el-button>
</el-form>
</div>