t-comm
Version:
专业、稳定、纯粹的工具库
21 lines (20 loc) • 481 B
TypeScript
/**
* 转化 rem 单位
* @param {string} content 输入内容
* @param {number} factor 转化比例,默认 100
* @param {string} unit 转化单位,默认 rpx
* @returns {string} 转化后的结果
*
* @example
* ```ts
* transFormRem('1.22rem')
* // 122rpx
*
* transFormRem('1.22rem', 50, 'px')
* // 61px
*
* transFormRem('.21rem', 50, 'px')
* // 10.50px
* ```
*/
export declare function transFormRem(content: string, factor?: number, unit?: string): string;