使用@submit.native.prevent
为el-form
设置提交方法。
使用native-type
为el-button
设置原生按钮类型。
示例如下:
html
<el-form class="search" @submit.native.prevent="submitSearch">
<div class='search-item'>人员ID :
<el-input size='mini' v-model='search.id' placeholder='请输入人员ID' clearable></el-input>
</div>
<div class='search-item'>
人员账号 :
<el-input size='mini' v-model='search.loginName' placeholder='请输入人员账号' clearable></el-input>
</div>
<div class="search-item">
<el-button size="mini" type="primary" @click="submitSearch" native-type="submit">查询</el-button>
</div>
</el-form>