1.0.1 • Published 2 years ago

yqjsutilscode v1.0.1

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

js-utils 工具库

  • 封装了常用的工具函数,开箱即用

兼容


兼容 ie9+ firefox chrome

npm 需要将代码发布到npm


https://www.npmjs.com/package/yqjsutilscode

npm 安装


npm i yqjsutilscode

commonjs


const yqJsUtils = require('yqjsutilscode')

or

const { throttle, isInViewPort }= require('yqjsutilscode')

es6


import * as  yqJsUtils from "yqjsutilscode";

or 

import { throttle, isInViewPort } from "yqjsutilscode";

浏览器script


   <script src="https://cdn.jsdelivr.net/npm/yqjsutilscode/dist/index.min.js"></script>
    <script>
        // yqJsUtils 是工具库全局导出的变量
        let a = { b: { val: 'test' } }
        let c = yqJsUtils.deepClone(a)
        console.log(c)
    </script>

目前收录的函数

dist/types 文件夹中每个函数都有相应的方法注释