html布局
<input class="searchInput" @keypress="fnToEnter" v-model="searchVal" placeholder="" type="text" />
js代码
fnToEnter(e){
if(e.keyCode == 13 || e.which == 13){
location.href = './search.html?keyword=' + this.searchVal;
}
},html布局
<input class="searchInput" @keypress="fnToEnter" v-model="searchVal" placeholder="" type="text" />
js代码
fnToEnter(e){
if(e.keyCode == 13 || e.which == 13){
location.href = './search.html?keyword=' + this.searchVal;
}
},