将唯一ID生成功能提取到单独的具模块中

This commit is contained in:
fofolee
2025-02-10 22:37:20 +08:00
parent 1a95259aef
commit 039a820952
4 changed files with 17 additions and 18 deletions

View File

@@ -252,13 +252,6 @@ export default defineComponent({
.padStart(2, "0")
);
},
getUniqueId() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
const r = (Math.random() * 16) | 0;
const v = c === "x" ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
},
},
watch: {
// 监听 glassEffect 值变化