<el-button slot="append" icon="search" @click="handSearch" @keyup.enter="handSearch"></el-button>
methods: {
handSearch(){
this.items.splice(0, this.items.length);
this.$store.dispatch('findNewsPage', {key: this.input})
}
}
First of all, the component does not have a built-in keyup event, so it should be @keyup.enter.native, but shouldn’t this event be written on the input component?
The buttons and input of the element component are unresponsive, but ordinary input and buttons are ok.
First go to the elementui documentation to see if there are custom events. If so, use the events provided by elementui.
If not, use the .native modifier to pass the event to the subcomponent
vue binds native events to components