1.1.2 • Published 4 years ago

wenhao-utils-package v1.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

文少前端工具包 wenhao-utils-package

文少提供的功能函数库,欢迎补充!

函数列表(完善中……)

函数名作用使用方式
debounce防抖newFunc=debounce(oldFunc)
throttle节流newFunc=throttle(oldFunc)
axios请求方法axios.get('https://apiurl.com')
removeProperty对象中移除单个keynewObj=removeProperty(oldObj,'name')
removeProperties对象中移除多个keynewObj=removeProperties(oldObj,'name1','name2')
isEqual深度对比对象是否相等const isEqual = isEqual(obj1,obj2)

使用方式:

step1 下载工具包

# 名称是你前面指定的库的名称
npm install wenhao-utils-package

step2-1 在网页中引用工具包

<script src="./node_modules/wenhao-utils-package/dist/index.js"></script>
<script>
  whutils.testUtils();
</script>

step2-2 模块化项目中引用并使用

// 使用ESM引入
import { testUtils } from "wenhao-utils-package";
testUtils(); //控制台打印内容:wenhao-utils-package成功引入!

// 使用commonjs引入
const { testUtils } = require("wenhao-utils-package");
testUtils(); //控制台打印内容:wenhao-utils-package成功引入!
1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago