0.1.0 • Published 4 years ago

@jk998/cli v0.1.0

Weekly downloads
-
License
-
Repository
-
Last release
4 years ago

@jk998/library

一个协助前端开发工程师快速实现世界和平的 Vue 库

依赖 Vue 提供的插件注册功能,提供常用方法、指令、过滤器

安装

yarn install @jk998/library

使用示例

import Vue from 'vue'

// 全局注册
import peace from '@jk998/library'
Vue.use(peace)

// dayjs 进行日期操作
peace.dayjs(new Date()).format('YYYY-MM-DD')

// numeral 进行数字操作
peace.numeral(-1000).format('$00.00')

// cache 进行数据存储
peace.cache.sessionStorage.set('ID', 'UUID')
peace.cache.sessionStorage.get('ID')

// validate 进行数据验证
peace.validate.isUrl('https://github.com/iamkun/dayjs')

// util 常用方法
peace.util.isType('字符串').isObject
peace.util.encode('字符串')

更多示例

参考

API 参考

  • util

    • peace.util.platform
    • peace.util.sign
    • peace.util.isType
    • peace.util.queryUrlParam
    • peace.util.arrayToTree
    • peace.util.deepClone
    • peace.util.encode
    • peace.util.decode
    • peace.util.alert

      peace.util.alert 依赖 Element-UI 外部库,未引用将使用 window.alert 代替

    • peace.util.warning

      peace.util.warning 依赖 Element-UI 外部库,未引用将使用 window.alert 代替

    • peace.util.success

      peace.util.success 依赖 Element-UI 外部库,未引用将使用 window.alert 代替

    • peace.util.error

      peace.util.error 依赖 Element-UI 外部库,未引用将使用 window.alert 代替

    • peace.util.formatDate

    • peace.util.formatTime
  • validate

    • peace.validate.pattern.username
    • peace.validate.pattern.password
    • peace.validate.pattern.url
    • peace.validate.pattern.number
    • peace.validate.pattern.numerical
    • peace.validate.pattern.pNumerical
    • peace.validate.pattern.interger
    • peace.validate.pattern.pInterger
    • peace.validate.pattern.nInterger
    • peace.validate.pattern.mobile
    • peace.validate.pattern.telephone
    • peace.validate.pattern.idCard
    • peace.validate.pattern.email
    • peace.validate.pattern.percente
    • peace.validate.isEmpty
    • peace.validate.isUrl
    • peace.validate.isNumber
    • peace.validate.isNumerical
    • peace.validate.isPNumerical
    • peace.validate.isInterger
    • peace.validate.isPInterger
    • peace.validate.isNInterger
    • peace.validate.isMobile
    • peace.validate.isEmail
    • peace.validate.isTelephone
    • peace.validate.isIDCard
    • peace.validate.isRange
  • cache

    • peace.cache.sessionStorage.get
    • peace.cache.sessionStorage.set
    • peace.cache.sessionStorage.remove
    • peace.cache.sessionStorage.clear
    • peace.cache.localStorage.get
    • peace.cache.localStorage.set
    • peace.cache.localStorage.remove
    • peace.cache.localStorage.clear
    • peace.cache.cookie.get
    • peace.cache.cookie.set
    • peace.cache.cookie.has
    • peace.cache.cookie.remove
    • peace.cache.cookie.clear
  • dayjs

  • numeral

更新记录

CHANGELOG.zh-CN.md