1.拓展scroll.vue事件

 1    beforeScroll:{
 2          type:Boolean,
 3          default:false
 4         }
 5 
 6 
 7   if(this.beforeScroll){//滚动列表的时候收起键盘(移动端)
 8             this.scroll.on('beforeScrollStart',()=>{
 9               this.$emit('beforeScroll')
10             })
11           }

2.在suggest.vue里声明beforeScrll:true,并$emit(beforeScroll)事件

1  beforeScroll(){
2           this.$emit('beforeScroll')
3         },

3.在搜索input框中写失去焦点事件:

1   blur(){
2             this.$refs.query.blur()
3           },

4.在search.vue父组件中调用子组件的blur方法;

1 blurInput(){
2             this.$refs.searchBox.blur()
3         },

 

相关文章:

  • 2022-01-21
  • 2021-09-26
  • 2022-12-23
  • 2021-09-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案