lodash防抖
文章目录
一
import _ from "lodash";
const infoBoxDebounce = _.debounce(fc => fc(), 500, { leading: true });
//方法
clickMethod(){
infoBoxDebounce(()=>{
//代码块
})
}二
<script>
import _ from 'lodash'
export default {
methods: {
//方法
clickMethod:_.debounce(function(){
//代码块
},1000)
}
}
</script>三
<script>
import _ from 'lodash'
export default {
methods: {
//方法
clickMethod:_.debounce(() => {
//代码块
},1000)
}
}
</script>
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论