Giter Club home page Giter Club logo

hz-utils's Introduction

@hz_org/utils

js 通用方法库

安装

npm i @hz_org/utils or @hz_org/utils

API

  • 获取浏览器可视区域高度 getClientHeight(): number
  • 百度坐标转高德 bMapConvertGMap(geo: geoType): geoType
  • 高德坐标转百度 gMapConvertBMap(geo: geoType): geoType
  • 对象数组去重 arrayUnique(arr = [], uniId = 'id'): array
  • 深拷贝 deepClone(obj: Object): object
  • 获取UUID getUUID(): number
  • 对象属性复制(以左侧对象为准) leftAssign(obj1: Object, obj2: Object): obj1
  • 生成随机len位数字 randomNumber(length, date): number
  • Element Plus Form 校验银行卡号位数 validateBankCard(rule, value, callback)
  • Element Plus Form 只能输入中文 validateChinese(rule, value, callback)
  • Element Plus Form 校验身份证号 validateIdCard(rule, value = '', callback)
  • Element Plus Form 验证手机号+固定电话 validateLandlineAndTel(rule, value, callback)
  • Element Plus Form 校验手机号码 validateTel(rule, value, callback)

API

  • esModule

    import { getClientHeight } from "@hz_org/utils"
    
  • cdn

    <script src="https://cdn.jsdelivr.net/npm/@hz_org/utils/index.js"></script>
    
    console.log(window['@hz_org/utils'].getClientHeight())
    

本地开发

git clone至本地
npm install
src下新建文件编写

打包编译

npm run build

npm 发布

1.更新package.json的version
2.copy根目录下的package.json和README.md至dist目录下
3.cd dist
4.npm publish

hz-utils's People

Contributors

zengxianghui93 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.