utils
utils package
Functions
| Function | Description |
|---|---|
| copy(input, { target }) | 复制字符串到剪贴板 必须响应用户手势事件调用,例如“click”或“keyup”。 |
| parseMilliseconds(milliseconds) | 将毫秒转换成对象 |
| prettyBytes(number, options) | Convert bytes to a human readable string: 1337 → 1.34 kB. |
| prettyMilliseconds(milliseconds, keepMilliseconds) | 将毫秒格式化成 n天n小时n分钟n秒[n毫秒] |
| second2str(seconds) | 秒转换成 n天n小时n分钟n秒 |
| slice2star(string, begin, end) | 提取字符串的一部分替换成 * 号,且不会改动原字符串 |
| toThousand(n, digits) | format a number to thousand points |
Namespaces
| Namespace | Description |
|---|---|
| Copy | Specify a DOM element where the temporary, behind-the-scenes textarea should be appended, in cases where you need to stay within a focus trap, like in a modal. |
| PrettyBytes |
Variables
| Variable | Description |
|---|---|
| parseMS | parseMilliseconds 的别名 |
| prettyMS | prettyMilliseconds 的别名 |
Type Aliases
| Type Alias | Description |
|---|---|
| TimeComponents |