UNPKG

press-ui

Version:

简单、易用的跨端组件库,兼容 Vue2 和 Vue3,同时支持 uni-app和普通 Vue 项目

22 lines (15 loc) 407 B
const camelizeRE = /-(\w)/g; export function camelize(str) { return str.replace(camelizeRE, (_, c) => c.toUpperCase()); } export function padZero(num, targetLength = 2) { let str = `${num}`; while (str.length < targetLength) { str = `0${str}`; } return str; } export function hyphenate(str) { const hyphenateRE = /\B([A-Z])/g; return str.replace(hyphenateRE, '-$1').toLowerCase(); }