Skip to content

Commit

Permalink
🎨 Update component.
Browse files Browse the repository at this point in the history
  • Loading branch information
tolerious committed Feb 2, 2025
1 parent 1042e5c commit 409a17c
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
1 change: 1 addition & 0 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ declare module 'vue' {
IconTooling: typeof import('./src/components/icons/IconTooling.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
WordOfTodayItem: typeof import('./src/components/WordOfTodayItem.vue')['default']
}
}
5 changes: 5 additions & 0 deletions src/components/WordOfTodayItem.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<div class="p-1 shadow-sm shadow-pink-300 rounded-sm inset-ring-2">1</div>
</template>

<script setup lang="ts"></script>
5 changes: 5 additions & 0 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ const router = createRouter({
name: 'login',
component: () => import('@/views/UserLogin.vue'),
},
{
path: '/today',
name: 'today',
component: () => import('@/views/TodayWords.vue'),
},
{
path: '/sharing/:groupID',
name: 'sharingPoster',
Expand Down
5 changes: 3 additions & 2 deletions src/views/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
>
</el-col>
<el-col :span="11">
<el-card class="cursor-pointer text-center" shadow="always" @click="redirect('recite')">
单词背诵
<el-card class="cursor-pointer text-center" shadow="always" @click="redirect('today')">
今日收藏
</el-card>
</el-col>
</el-row>
Expand Down Expand Up @@ -147,6 +147,7 @@ function redirect(condition: string) {
if (condition === 'settings') router.push('/settings');
if (condition === 'help') router.push('/help');
if (condition === 'square') router.push('/square');
if (condition === 'today') router.push('/today');
}
function mapWeekDay(week: string) {
Expand Down
17 changes: 17 additions & 0 deletions src/views/TodayWords.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<template>
<Header title="Words of Today" @goBack="handleGoBack"></Header>
<div class="p-2 grid grid-cols-5 gap-3">
<word-of-today-item v-for="i in 30" :key="i"></word-of-today-item>
</div>
</template>

<script setup lang="ts">
import Header from '@/components/Header.vue';
import WordOfTodayItem from '@/components/WordOfTodayItem.vue';
import { useRouter } from 'vue-router';
const router = useRouter();
function handleGoBack() {
router.go(-1);
}
</script>

0 comments on commit 409a17c

Please sign in to comment.