el-form
表单里,给el-input
标签添加enter
事件,回车时刷新页面
解决方案:在el-form
标签里添加@submit.native.prevent
<el-form :model="form" ref="form" size="mini" :rules="rules" label-width="90px" @submit.native.prevent>
<el-form-item label="联系电话:" prop="phone">
<el-input v-model="form.phone" placeholder="请输入联系电话" @keyup.enter.native="onQuery"></el-input>
</el-form-item>
<el-form-item label="" label-width="0">
<el-button type="primary" @click="onQuery">查 询</el-button>
</el-form-item>
</el-form>
网友评论