VUE项目。如代码,在IE浏览器中 光标进入文本框,点击Enter键,页面跳转到了首页。怎么办???
<form class="bs-example bs-example-form" role="form">
<div class="input-group">
<input type="text" class="form-control" :placeholder="placehold" v-model="requestData.projName" autocomplete="off">
<span class="input-group-btn">
<button class="btn btn-default" type='button' @click.prevent="selectedProjList">
<i class="fa fa-search" aria-hidden="true"></i>
</button>
</span>
</div>
</form>
很简单:
把Button按钮的 type='button 去掉就可以了
<button class="btn btn-default" @click.prevent="selectedProjList">
<i class="fa fa-search" aria-hidden="true"></i> <!-- 这里把type='button去掉就可以了' -->
</button>