| 
									
										
										
										
											2022-09-16 18:14:04 +08:00
										 |  |  |  | <template> | 
					
						
							|  |  |  |  |   <div id="indexPage"> | 
					
						
							| 
									
										
										
										
											2022-09-16 19:06:06 +08:00
										 |  |  |  |     <h1>🐟 鱼了个鱼</h1> | 
					
						
							|  |  |  |  |     <div style="margin-bottom: 16px">低配版羊了个羊小游戏,仅供消遣</div> | 
					
						
							|  |  |  |  |     <a-button | 
					
						
							|  |  |  |  |       block | 
					
						
							|  |  |  |  |       style="margin-bottom: 16px" | 
					
						
							|  |  |  |  |       @click="toGamePage(easyGameConfig)" | 
					
						
							|  |  |  |  |     > | 
					
						
							|  |  |  |  |       简单模式 | 
					
						
							|  |  |  |  |     </a-button> | 
					
						
							|  |  |  |  |     <a-button | 
					
						
							|  |  |  |  |       block | 
					
						
							|  |  |  |  |       style="margin-bottom: 16px" | 
					
						
							|  |  |  |  |       @click="toGamePage(middleGameConfig)" | 
					
						
							|  |  |  |  |     > | 
					
						
							|  |  |  |  |       中等模式 | 
					
						
							|  |  |  |  |     </a-button> | 
					
						
							|  |  |  |  |     <a-button | 
					
						
							|  |  |  |  |       block | 
					
						
							|  |  |  |  |       style="margin-bottom: 16px" | 
					
						
							|  |  |  |  |       @click="toGamePage(hardGameConfig)" | 
					
						
							|  |  |  |  |     > | 
					
						
							|  |  |  |  |       困难模式 | 
					
						
							|  |  |  |  |     </a-button> | 
					
						
							|  |  |  |  |     <a-button | 
					
						
							|  |  |  |  |       block | 
					
						
							|  |  |  |  |       style="margin-bottom: 16px" | 
					
						
							|  |  |  |  |       @click="toGamePage(lunaticGameConfig)" | 
					
						
							|  |  |  |  |     > | 
					
						
							|  |  |  |  |       地域模式 | 
					
						
							|  |  |  |  |     </a-button> | 
					
						
							|  |  |  |  |     <a-button block style="margin-bottom: 16px" disabled @click="toGamePage"> | 
					
						
							|  |  |  |  |       自定义(暂未开放) | 
					
						
							|  |  |  |  |     </a-button> | 
					
						
							| 
									
										
										
										
											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 { | 
					
						
							|  |  |  |  |   easyGameConfig, | 
					
						
							|  |  |  |  |   middleGameConfig, | 
					
						
							|  |  |  |  |   hardGameConfig, | 
					
						
							|  |  |  |  |   lunaticGameConfig, | 
					
						
							|  |  |  |  | } from "../core/gameConfig"; | 
					
						
							|  |  |  |  | import { useGlobalStore } from "../core/globalStore"; | 
					
						
							| 
									
										
										
										
											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-16 19:06:06 +08:00
										 |  |  |  | const toGamePage = (config?: GameConfig) => { | 
					
						
							|  |  |  |  |   if (config) { | 
					
						
							|  |  |  |  |     setGameConfig(config); | 
					
						
							|  |  |  |  |   } | 
					
						
							|  |  |  |  |   router.push("/game"); | 
					
						
							|  |  |  |  | }; | 
					
						
							|  |  |  |  | </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; | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | </style> |