vue 回车事件
- 首页
<template>
<div class="index">
<input class="inp"
v-model="input"
placeholder="请输入"
@keyup.enter="getCompanySearchList">
<el-button class="searchBtn"
slot="append"
@click="getCompanySearchList">
搜索
</el-button>
</div>
</template>
<script>
export default {
components: {
},
data() {
return {
input: ''
};
},
watch:{
},
created(){
},
methods: {
getCompanySearchList(){
this.$router.push({
name : 'list',
query : {
val : this.input
}
})
},
}
}
</script>
<style