hgweb的博客

https://www.niwoxuexi.com/blog/user/151

  • JS - Lodash工具库的使用详解3(String字符串操作函数)

    三、String 字符串操作函数1,将字符串转换成驼峰命名camelCase 函数可以将字符串中非数字和字母的字符都过滤掉,然后再转换为驼峰。console.log(_.camelCase('Foo Bar')) // => 'fooBar' console.log(_.camelCase('--foo-bar--')) // => 'fooBar' console.log(_.c ...

    • 更新时间: 2019-10-16 02:31
    2689浏览
    0推荐
    0评论
  • JS - Lodash工具库的使用详解2(使用throttle函数实现节流)

    二、使用 throttle 函数实现节流1,throttle 节流throttle 函数原型如下。它会创建一个节流函数,在 wait 秒内最多执行 func 一次的函数。_.throttle(func, [wait=0], [options={}]) (1)throttle 的功能和前文介绍的 debounce 很像,都是为了防止某个方法被频繁调用。不同的是,throttle 可以指定每隔多长时 ...

    • 更新时间: 2019-10-16 02:30
    2911浏览
    0推荐
    0评论
  • JS - Lodash工具库的使用详解1(使用debounce函数实现防抖)

    Lodash 是一个一致性、模块化、高性能的 JavaScript 实用工具库。Lodash 通过降低 array、number、objects、string 等等的使用难度从而让 JavaScript 变得更简单。同时其在 npm 每天下载量都超过 200 万,足以证明了它受欢迎的程度。 一、使用 debounce 函数实现防抖1,安装配置(1)这里假设我们需要在 Vue.js 项目里使用 L ...

    • 更新时间: 2019-10-16 02:30
    2655浏览
    0推荐
    0评论