1.0.8 • Published 2 years ago
cm-tool2 v1.0.8
编译
npm run build
工具说明
cookie_session_storage
addCookie(name: string, value: string | number, iDay: number) [添加cookie]
getCookie(name: string) [获取cookie]
removeCookie(name: string) [删除cookie]
clearAllCookie() [删除全部cookie]
setStorage(name: string, content: any) [添加storage, 对象需要JSON.stringify()]
getStorage(name: string) [获取stroage, 对象需要JSON.parse()]
removeStorage(name: string) [移除storage]
setSession(name: string, value: any) [添加session]
getSession(name: string) [获取session]
removeSession(name: string) [移除session]
getQueryVariable(variable: string) [获取url参数]
debounce(fn: () => void , wait: number) [防抖函数,underscore 源码支持取消延迟,loadsh等工具库]
throttle(fn: () => void , wait: number) [节流函数,underscore 源码支持取消延迟,loadsh等工具库]
request 原生请求工具
download_image 图片下载工具
get_richtext_img_src 获取富文本里面的所有图片地址
get_location_search 获取rul参数,以对象形式返回
filter_tree 过滤树形数据
replaceRichTextImg 替换符文中的所有图片标签 例如:替换成【图片】
formatRMB 格式化人民币金额