Skip to content

Commit

Permalink
feat: add tool
Browse files Browse the repository at this point in the history
  • Loading branch information
cuixiaorui committed Jan 24, 2024
1 parent ec03c67 commit 8b17249
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
26 changes: 26 additions & 0 deletions apps/client/components/main/Tool.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<template>
<div class="fixed right-5 top-24 w-28 h-40 bg-pink-500">
<div>
<NuxtLink href="/courses"> 更多课程 </NuxtLink>
</div>
<div>{{ coursesStore.currentCourse.title }}</div>
<div>
<button @click="handleDoAgain">重新开始</button>
</div>
</div>
</template>

<script setup lang="ts">
import { useCoursesStore } from "~/store/courses";
import { useMode } from "./game";
const coursesStore = useCoursesStore();
const { showQuestion } = useMode();
function handleDoAgain() {
coursesStore.doAgain();
showQuestion()
}
</script>

<style scoped></style>
6 changes: 5 additions & 1 deletion apps/client/pages/Main/[id].vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<template>
<Game></Game>
<div class="relative">
<Game></Game>
<Tool></Tool>
</div>
</template>

<script setup lang="ts">
import Game from "~/components/main/Game.vue";
import Tool from '~/components/main/Tool.vue';
import { useCoursesStore } from "~/store/courses";
const route = useRoute();
Expand Down

0 comments on commit 8b17249

Please sign in to comment.