<input type="text" @focus="searchfun" @blur="searchfun_close" ref="inputref">
//input失去焦点时执行的方法
searchfun_close(){
this.searchpopupShow=false
},
//input当前获取焦点执行的方法
searchfun(){
this.searchpopupShow=true
},
//让input框获取焦点
searchfuns(){
this.$refs.inputref.focus()
}
The @focus method is executed when the focus is obtained
The @blur method is executed when the focus is lost
Let the input box get the focus through ref