diff --git a/.env b/.env index f1d830a..3e950b1 100644 --- a/.env +++ b/.env @@ -2,3 +2,4 @@ VITE_REQUEST_BASE_URL=https://wzpmc.cn:18080 # VITE_REQUEST_BASE_URL=http://172.16.114.84:58082 VITE_WEBSOCKET_BASE_URL=wss://wzpmc.cn:18080 # VITE_WEBSOCKET_BASE_URL=ws://172.16.114.84:58082 +VITE_GAME_2048_DEBUG=true diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 6028908..5ff3728 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -9,12 +9,11 @@ module.exports = { '@vue/eslint-config-typescript', '@vue/eslint-config-prettier/skip-formatting', ], - parserOptions: { - ecmaVersion: 'latest', - }, + parserOptions: { ecmaVersion: 'latest' }, rules: { 'vue/no-unused-vars': 'warn', 'vue/multi-word-component-names': 'off', 'vue/valid-v-for': 'off', + 'no-redeclare': 'off', }, }; diff --git a/env.d.ts b/env.d.ts index 08aae2f..e63b049 100644 --- a/env.d.ts +++ b/env.d.ts @@ -5,4 +5,5 @@ type BooleanString = 'true' | 'false'; interface ImportMetaEnv { readonly VITE_REQUEST_BASE_URL: string; readonly VITE_WEBSOCKET_BASE_URL: string; + readonly VITE_GAME_2048_DEBUG: BooleanString; } diff --git a/src/components/game2048/Game2048.vue b/src/components/game2048/Game2048.vue index cd7463a..f3ca690 100644 --- a/src/components/game2048/Game2048.vue +++ b/src/components/game2048/Game2048.vue @@ -767,10 +767,10 @@ onMounted(async () => { onUnmounted(() => { locked.value = true; isUnmounted = true; - for (const future of chainIterables([ + for (const future of chainIterables( tileAddFutureMap.values(), tileTransitionFutureMap.values(), - ])) { + )) { future.resolve(); } }); diff --git a/src/components/game2048/Game2048V2.vue b/src/components/game2048/Game2048V2.vue index 0bcfd70..6adedd3 100644 --- a/src/components/game2048/Game2048V2.vue +++ b/src/components/game2048/Game2048V2.vue @@ -4,22 +4,21 @@
{{ tile.renderState.number }} +
#{{ tile.id }}
@@ -50,8 +49,183 @@ .bg-tile { background-color: rgb(205, 193, 180); } +.id { + position: absolute; + font-size: 15px; + right: 10px; + bottom: 10px; + line-height: 1; +} - -