@keyup.enter=“submit” 和 @click=“submit” 不能绑在同一个地方,否则回车不起作用
错误:
<div class="layui-form-item" style="text-align: center">
<button style="width:100%" class="layui-btn" @click="submit" @keyup.enter="submit" >登录</button>
</div>
正确:
<div class="layui-form-item">
<input type="text" class="layui-input" v-model="rex" style="display:inline-block; width: 255px;"
placeholder="请输入验证码(不区分大小写)" autocomplete="off" required lay-verify="required" @keyup.enter="submit" >
<canvas id="canvas" width="110" height="43"
style="display:inline-block;border:1px solid #eee;height:36px; float: right;" @click="refresh"></canvas>
</div>
<div class="layui-form-item" style="text-align: center">
<button style="width:100%" class="layui-btn" @click="submit" >登录</button>
</div>