12345678910111213141516171819202122232425262728293031 |
- <!-- 游戏页面 -->
- <template>
- <!-- 积分 -->
- <view>{{credit}}</view>
- <!-- 桌面食物 -->
- <foodVue :shiwuId="shiwuId"></foodVue>
- <!-- 大鹅 4阶段 -->
- <gooseVue :growth="growth" :growthType="growthType" :progress="progress"></gooseVue>
- <!-- 食物选择 -->
- <foodSelectVue ref="foodSelectRef" :shiwuId="shiwuId" @weishi="onWeiShi"></foodSelectVue>
- </template>
- <script setup>
- import {ref} from "vue";
- import foodVue from "./components/food.vue";
- import gooseVue from "./components/goose.vue";
- import foodSelectVue from "./components/foodSelect.vue";
- import { useGame } from "./useGame";
- const { credit,growth,growthType,progress,shiwuId ,handleWeishi } = useGame();
-
- const foodSelectRef = ref(null);
-
- function onWeiShi(data) {
- handleWeishi(data.id, () => {
- foodSelectRef.value.handleClose();
- })
- }
- </script>
- <style>
- </style>
|