1.0.16 • Published 2 years ago

thepaper-utils v1.0.16

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

澎湃前端工具库

📦 Install

  1. 支持打包压缩版(x.min.js)和非压缩版本(x.js)。

  2. 支持 AMD/CJS/ESM 模块引入。

  3. 支持通过script脚本直接引入链接。

// ESM
import * as utils from 'thepaper-utils';

//cjs
const Tool = require('thepaper-utils');

// AMD
require(['thepaper-utils'],function(){
  ...
})

// script 脚本
<script src="https://xxx.com/thepaper-utils.min.js"></script>
npm i thepaper-utils
yarn add thepaper-utils

🔨 Usage

import utils from 'thepaper-utils'

方法调用说明返回
iosOrAndroidutils.iosOrAndroid()判断当前所在的环境ios\android\undefined
checkCodeutils.checkCode(value, type)value: 传入需要验证的值type: phone\mail\idcard\account\numbertrue\false
getQueryutils.getQuery()获取url的参数{id: 'xxx', age: 'xxx'}
wxShareutils.wxShare(wxConfig, shareData)微信分享wxConfig: { appId, timestamp, nonceStr, signature, jsApiList(非必选) } shareData: { title, link, imgUrl, desc }

\

调用方法同上,暴露出来的是 utils

Use One

import utils from 'thepaper-utils';

console.log(utils.iosOrAndroid());

Use Two

<script src="https://xxx.com/thepaper-utils.min.js"></script>

<script>
	console.log(utils.iosOrAndroid())
</script>
1.0.16

2 years ago

1.0.11

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago