软键盘搜索按钮同步搜索框

2018-11-07  本文已影响19人  苏本的书柜
 searchProducent(event) { 
                if (event.keyCode == 13) { //如果按的是enter键 13是enter 
                    event.preventDefault(); //禁止默认事件(默认是换行) 
                    this.$refs.search.blur();
                    // event.path[0].blur();
                    // console.log(event.path[0]);
                    // console.log(event.target.value)
                    // this.$toast(`搜索${event.target.value}`) 
                    this.pull(false)
                } 
            } ,
上一篇 下一篇

猜你喜欢

热点阅读