sheep/src/pages/IndexPage.vue

105 lines
2.2 KiB
Vue
Raw Normal View History

2022-09-16 18:14:04 +08:00
<template>
<div id="indexPage">
2022-09-22 01:19:42 +02:00
<h1>喵了个喵ฅʕ̫͡ʔฅ</h1>
<div style="margin-bottom: 16px">改编自鱼了个鱼</div>
<!-- <a-button
2022-09-16 19:06:06 +08:00
block
style="margin-bottom: 16px"
@click="toGamePage(easyGameConfig)"
2022-09-22 01:19:42 +02:00
> -->
<!-- 简单模式
2022-09-16 19:06:06 +08:00
</a-button>
<a-button
block
style="margin-bottom: 16px"
2022-09-22 01:19:42 +02:00
@click="toGamePage(middleGameConfig)" -->
<!-- > -->
<!-- 中等模式
2022-09-16 19:06:06 +08:00
</a-button>
<a-button
block
style="margin-bottom: 16px"
@click="toGamePage(hardGameConfig)"
2022-09-22 01:19:42 +02:00
> -->
<!-- 困难模式 -->
<!-- </a-button> -->
2022-09-16 19:06:06 +08:00
<a-button
block
style="margin-bottom: 16px"
@click="toGamePage(lunaticGameConfig)"
>
2022-09-16 22:41:26 +08:00
地狱模式
2022-09-16 19:06:06 +08:00
</a-button>
2022-09-22 01:19:42 +02:00
<!-- <a-button
block
style="margin-bottom: 16px"
@click="toGamePage(skyGameConfig)"
>
天域模式
2022-09-22 01:19:42 +02:00
</a-button> -->
<a-button
block
style="margin-bottom: 16px"
@click="toGamePage(yangGameConfig)"
>
羊了个羊模式
</a-button>
2022-09-17 17:30:42 +08:00
<a-button block style="margin-bottom: 16px" @click="() => toGamePage()">
自定义 🔥
2022-09-16 19:06:06 +08:00
</a-button>
<my-ad />
2022-09-17 12:09:46 +08:00
<div class="footer">
2022-09-22 01:19:42 +02:00
喵了个喵 ©2022 by
<a href="https://github.com/MeiXue16" target="_blank" style="color: #fff">
Mei
2022-09-17 12:09:46 +08:00
</a>
|
2022-09-22 01:19:42 +02:00
<a href=" " target="_blank" style="color: #fff"> 代码开源 </a>
2022-09-17 12:09:46 +08:00
</div>
2022-09-16 18:14:04 +08:00
</div>
</template>
<script setup lang="ts">
2022-09-16 19:06:06 +08:00
import { useRouter } from "vue-router";
import {
2022-09-22 01:19:42 +02:00
// easyGameConfig,
// middleGameConfig,
// hardGameConfig,
2022-09-16 19:06:06 +08:00
lunaticGameConfig,
2022-09-22 01:19:42 +02:00
// skyGameConfig,
yangGameConfig,
2022-09-16 19:06:06 +08:00
} from "../core/gameConfig";
import { useGlobalStore } from "../core/globalStore";
import MyAd from "../components/MyAd.vue";
2022-09-16 18:14:04 +08:00
2022-09-16 19:06:06 +08:00
const router = useRouter();
2022-09-16 18:14:04 +08:00
2022-09-16 19:06:06 +08:00
const { setGameConfig } = useGlobalStore();
2022-09-16 18:14:04 +08:00
2022-09-17 12:09:46 +08:00
const toGamePage = (config?: GameConfigType) => {
2022-09-16 19:06:06 +08:00
if (config) {
setGameConfig(config);
2022-09-16 22:17:31 +08:00
router.push("/game");
} else {
router.push("/config");
2022-09-16 19:06:06 +08:00
}
};
</script>
2022-09-16 18:14:04 +08:00
2022-09-16 19:06:06 +08:00
<style scoped>
#indexPage {
2022-09-16 18:14:04 +08:00
text-align: center;
}
2022-09-17 12:09:46 +08:00
.footer {
background: rgba(0, 0, 0, 0.6);
color: #fff;
padding: 12px;
text-align: center;
position: fixed;
bottom: 0;
left: 0;
right: 0;
}
2022-09-16 18:14:04 +08:00
</style>