Skip to content

Commit

Permalink
更新配置
Browse files Browse the repository at this point in the history
  • Loading branch information
gaojianghua committed Nov 30, 2024
1 parent bdc2ee0 commit 4835ad2
Show file tree
Hide file tree
Showing 7 changed files with 498 additions and 985 deletions.
4 changes: 2 additions & 2 deletions App.uvue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
</script>

<style>
@import "./common/main.css";
@import "./common/common.css";
@import url("common/main.css");
@import url("common/common.css");
</style>
21 changes: 21 additions & 0 deletions common/id.uts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const urlAlphabet =
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'

/**
* nano 唯一id生成器
* 比传统 uuid 生成快 60%
*
* https://github.com/ai/nanoid
*
* 默认设置size为21,每秒生成一亿份id,连续工作四个世纪产生一次冲突的概率为 1%。
* html标签的id属性不能以数字作为前缀,所以以字母作为前缀
*/
export function nanoid(size = 21, prefix = 'T'): string {
let id = ''
let i = size
while (i-- != 0) {
id += urlAlphabet[(Math.random() * 64) | 0]

}
return prefix + id
}
Loading

0 comments on commit 4835ad2

Please sign in to comment.