vue-cli watch/timer

watch 监听函数

data:{
    letter:''
},
watch:{
    letter(){
             xxxxxx
    }    
},            

timer

data(){
    return{
    timer:null            
    }
},
handletimer(e){
    if(this.timer){
    clearTimeout(this.timer)
    }
    this.timer=setTimeout(()=>{
        
    },16)
}
    

 

posted @ 2018-12-16 13:31  wanan_01  阅读(192)  评论(0编辑  收藏  举报