How to implement debounce in Vue2?

前端 未结 13 664
梦谈多话
梦谈多话 2020-11-27 11:08

I have a simple input box in a Vue template and I would like to use debounce more or less like this:



        
13条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-27 11:24

    If you are using Vue you can also use v.model.lazy instead of debounce but remember v.model.lazy will not always work as Vue limits it for custom components.

    For custom components you should use :value along with @change.native

提交回复
热议问题