@txdfe/at
Version:
一个设计体系组件库
21 lines (19 loc) • 420 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = _default;
var timestamp = Date.now();
/**
* 生成全局唯一的id
* @param {String} [prefix=''] 前缀字符串
* @return {String}
*
* @example
* guid(); // j7jv509c
* guid('prefix-'); // prefix-j7jv509d
*/
function _default(prefix) {
prefix = prefix || '';
return prefix + (timestamp++).toString(36);
}