element 表单input回车刷新页面解决办法
在开发页面的时候,进行表单查询,点击输入框然后按下回车会刷新页面
解决办法:
一. 在el-form标签中添加@submit.native.prevent<el-form @submit.native.prevent>
代码:
<el-form ref="searchItem" :model="searchItem" :inline="true" @submit.native.prevent>
<el-form-item label="" prop="videoName">
<el-input v-model="searchItem.searchName" @keyup.enter.native="handleQuery" placeholder="请输入视频名称" clearable size="small" style="width: 240px" />
</el-form-item>
<el-form-item>
<el-button type="primary" size="mini" @click="handleQuery">查询</el-button>
<el-button size="mini" type="success" @click="resetQuery">刷新</el-button>
<el-button size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>