wip: Table component developing
This commit is contained in:
@@ -95,3 +95,15 @@ export function formatTime(time: Date | number | string, fmt: string) {
|
||||
return fmt
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成随机字符串
|
||||
*/
|
||||
export function toAnyString() {
|
||||
const str: string = 'xxxxx-xxxxx-4xxxx-yxxxx-xxxxx'.replace(/[xy]/g, (c: string) => {
|
||||
const r: number = (Math.random() * 16) | 0
|
||||
const v: number = c === 'x' ? r : (r & 0x3) | 0x8
|
||||
return v.toString()
|
||||
})
|
||||
return str
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user