fix(layer): 使用 guid 作为 layer 实例的唯一标识

This commit is contained in:
就眠仪式
2021-11-07 21:50:38 +08:00
parent 9e4f2918d5
commit 6f19ff7c9b
3 changed files with 11 additions and 3 deletions

7
src/tools/guidUtil.ts Normal file
View File

@@ -0,0 +1,7 @@
export function S4() {
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
};
export function guid() {
return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
};