1.html
<form @submit.prevent="formSubmit" action="javascript:return true">
<input type="search" placeholder="请输入姓名" @keyup.13="search()" @blur="clear()" v-model="peopleName">
</form>
2.js
export default {
methods: {
forSubmit () {
return false
}
}
}
3.关键点
1.input type="search"
2.input 外面套form,必须要有action,action=“javascript:return true”
3.表单提交阻止默认提交事件,如jquery写法
$("form").submit(function(){
return false
})