解决方案:使用@key.enter.native
<el-input v-model="form.loginName" placeholder="账号" @keyup.enter.native="doLogin"> </el-input>