feat: 添加游戏画布容器组件
This commit is contained in:
33
src/views/game/components/GameCanvas.vue
Normal file
33
src/views/game/components/GameCanvas.vue
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<template>
|
||||||
|
<div class="game-canvas">
|
||||||
|
<GomokuBoard v-if="store.gameId === 'gomoku'" />
|
||||||
|
<!-- 后续其他游戏在此添加 -->
|
||||||
|
<div v-else class="game-canvas__unsupported">
|
||||||
|
<p>暂不支持的游戏类型</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { useRoomStore } from '@/stores'
|
||||||
|
import { storeToRefs } from 'pinia'
|
||||||
|
import GomokuBoard from './GomokuBoard.vue'
|
||||||
|
|
||||||
|
const store = useRoomStore()
|
||||||
|
const { gameId } = storeToRefs(store)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.game-canvas {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-canvas__unsupported {
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user