1 Star 0 Fork 0

karlkidd8080 / k-collection

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 1.85 KB
一键复制 编辑 原始数据 按行查看 历史
lu.yunlong 提交于 2022-06-20 14:09 . 初始化

Install

 npm install --save k-collection

Example

// if you use require
const kCollection = require('k-collection');
console.log(kCollection,'=====kCollection')

or

// if you use import, you can import
import { kCollection } from  'k-collection';
// or
import kCollection from  'k-collection';
console.log(kCollection,'=====kCollection')

Api

{
  author: "karlkidd",
  install: ƒ (Vue),
  kCloneDeep: v => {},
  kCompressImage: (file, callBack, convertToBase64 = false) => {},
  kCookies: {install: ƒ, setCookie: ƒ, setCookieConfig: ƒ, getCookie: ƒ, delCookie: ƒ},
  kCopyText: ƒ copyText(value),
  kDateFormat: ƒ kDateFormat(fmt, date),
  kDebounce: ƒ kDebounce(fn, wait=1000),
  kExportExcel: ƒ kExportExcel(interfaceParameters),
  kRegExp: {intReg: /^\d{1,}$/, floatReg: /^\d+\.\d+$/, numReg: /^[0-9.]+$/, IMEI: /^\d{15,17}$/, },
  kThrottle: ƒ kThrottle(fn, delay=1000),
  kUserAgent: {uaInfo: 'other', wx: false, ios: false, android: false, wxIos: false, },
  name: "k-collection",
  version: "0.0.02",
}

// If you want use in vue 
vue.use(kCollection)
kCompressImage
kCompressImage(file,callbackFun,false);
callbackFun(res){
  console.log(res)
}
kCookies
{
  delCookie: ƒ delCookie(name),
  getCookie: ƒ getCookie(name),
  install: ƒ (Vue),
  setCookie: ƒ setCookie(key,value,expires,domains,path),
  setCookieObj: ƒ setCookieConfig(obj) // obj is {key,value,expires,domains,path},
}
// if you want set cookie 
kCookies.setCookie(key,value,expires,domains,path)
// or
kCookies.setCookie({key,value,expires,domains,path})
//or
kCookies.setCookieObj({key,value,expires,domains,path})

// get cookie or delect cookie 
kCookies.getCookieObj(name)
kCookies.delCookieObj(name)
kCopyText
kCopyText(string).then(()=>{
  alert('copy success')
})
1
https://gitee.com/karlkidd8080/k-collection.git
git@gitee.com:karlkidd8080/k-collection.git
karlkidd8080
k-collection
k-collection
master

搜索帮助