-
cross-env 跨平臺(tái)設(shè)置和使用環(huán)境變量
設(shè)置
{
"scripts": {
"build": "cross-env NODE_ENV=production webpack --config build/webpack.config.js"
}
}
使用
const NODE_ENV = process.env.NODE_ENV;
if(NODE_ENV==='production'){
}else{
}
參考:
http://www.reibang.com/p/696bd579f9ec
https://blog.csdn.net/qq_26927285/article/details/78105510
https://github.com/kentcdodds/cross-env
加解密
https://github.com/brix/crypto-js
-
金額計(jì)算
bignumber.js
A JavaScript library for arbitrary-precision decimal and non-decimal arithmetic.
0.3 - 0.1 // 0.19999999999999998
x = new BigNumber(0.3)
x.minus(0.1) // "0.2"
x // "0.3"
參考:
https://github.com/MikeMcl/bignumber.js
decimal.js
An arbitrary-precision Decimal type for JavaScript.
A Decimal is immutable in the sense that it is not changed by its methods.
0.3 - 0.1 // 0.19999999999999998
x = new Decimal(0.3)
x.minus(0.1) // '0.2'
x // '0.3'
參考:
https://github.com/MikeMcl/decimal.js
http://mikemcl.github.io/decimal.js/
JS判斷是不是Decimal類型(正則實(shí)現(xiàn)) https://www.cnblogs.com/xachary/p/3631178.html
-
crypto
JavaScript library of crypto standards.
加解密
https://github.com/brix/crypto-js
js操作
- 字符串操作
JavaScript字符串操作方法總結(jié)(含ES6方法) https://blog.csdn.net/shunlu/article/details/83897447
字符串的新增方法 https://es6.ruanyifeng.com/#docs/string-methods
https://www.w3school.com.cn/js/js_string_methods.asp
-
lodash
Lodash makes JavaScript easier by taking the hassle out of working with arrays,
numbers, objects, strings, etc. Lodash’s modular methods are great for:
- Iterating arrays, objects, & strings
- Manipulating & testing values
- Creating composite functions
lodash之Array方法 https://www.cnblogs.com/shikelong/p/4489615.html
https://github.com/lodash/lodash
-
二維地圖
可能mapbox更優(yōu)秀一些;
二維地圖展示以及添加圖標(biāo)咕娄、文本亥揖、連線、彈窗等功能實(shí)現(xiàn)
二維地圖展示以及添加圖標(biāo)圣勒、文本费变、連線摧扇、彈窗等功能實(shí)現(xiàn) http://www.reibang.com/p/0e6f67380ad1
http://www.mapbox.cn/
http://www.mapbox.cn/mapbox-gl-js/example/popup-on-click/
https://www.mapbox.com/
OpenLayers 官網(wǎng)例子的中文詳解 https://segmentfault.com/a/1190000009679800
https://openlayers.org/en/latest/examples/vector-layer.html
https://leafletjs.com/
https://leafletjs.com/examples.html
https://leafletjs.com/examples/quick-start/
https://lbsyun.baidu.com/index.php?title=jspopularGL/guide/infoWindow
https://lbsyun.baidu.com/jsdemo.htm#webgl1_4
-
3D地圖
mars3d http://www.mars3d.cn/doc
Cesium https://cesium.com/platform/cesiumjs/
-
使用百度獲取地理位置信息-當(dāng)前定位
使用百度獲取地理位置信息-當(dāng)前定位 http://www.reibang.com/p/8dc84db3a616