diff --git a/src/core/main/storage.ts b/src/core/main/storage.ts index 56db08b..4d8211b 100644 --- a/src/core/main/storage.ts +++ b/src/core/main/storage.ts @@ -98,6 +98,15 @@ export class GameStorage { static get(key: string) { return this.list.find(v => v.key === key); } + + /** + * 与Symbol.for类似 + */ + static for(key: string) { + const s = this.get(key); + if (s) return s; + else return new GameStorage(key); + } } window.addEventListener('beforeunload', () => { diff --git a/src/ui/fly.vue b/src/ui/fly.vue index 119bfe1..8bb9380 100644 --- a/src/ui/fly.vue +++ b/src/ui/fly.vue @@ -89,12 +89,7 @@