|
10 | 10 | <script lang="ts" setup> |
11 | 11 | import type { TodoList } from '@/types/todo' |
12 | 12 |
|
| 13 | +const router = useRouter() |
| 14 | +
|
13 | 15 | const { t } = useI18n() |
14 | 16 |
|
15 | 17 | const title = computed(() => { |
@@ -42,20 +44,48 @@ function fetchData() { |
42 | 44 | loading.value = false |
43 | 45 | }) |
44 | 46 | } |
| 47 | +
|
| 48 | +function goPage(path: string) { |
| 49 | + router.push(path) |
| 50 | +} |
| 51 | +
|
| 52 | +function goDynamicRoute() { |
| 53 | + goPage(`/dynamic/${Math.random().toString().slice(2, 6)}`) |
| 54 | +} |
45 | 55 | </script> |
46 | 56 |
|
47 | 57 | <template> |
| 58 | + <TheCard my-5> |
| 59 | + <div flex="~ items-center justify-center gap-2 wrap" mx-auto mb-5> |
| 60 | + <TheButton @click="goPage('/')"> |
| 61 | + {{ t('button.index-page') }} |
| 62 | + </TheButton> |
| 63 | + <TheButton @click="goPage('/about')"> |
| 64 | + {{ t('button.about-page') }} |
| 65 | + </TheButton> |
| 66 | + <TheButton @click="goPage('/404')"> |
| 67 | + {{ t('button.404-page') }} |
| 68 | + </TheButton> |
| 69 | + <TheButton @click="goDynamicRoute"> |
| 70 | + {{ t('button.dynamic-route') }} |
| 71 | + </TheButton> |
| 72 | + </div> |
| 73 | + <p> |
| 74 | + {{ t('button.dynamic-route-description') }} |
| 75 | + </p> |
| 76 | + </TheCard> |
48 | 77 | <TheCard my-5> |
49 | 78 | <TheButton mx-auto mb-5 @click="toggleLogo"> |
50 | 79 | {{ headerLogo ? t('button.hide-logo') : t('button.show-logo') }} |
51 | 80 | </TheButton> |
52 | | - <p> |
53 | | - {{ t('button.toggle-logo-description') }} |
| 81 | + <p flex="~ items-center justify-center gap-2"> |
| 82 | + <i i-logos-pinia /> |
| 83 | + <span>{{ t('button.toggle-logo-description') }}</span> |
54 | 84 | </p> |
55 | 85 | </TheCard> |
56 | 86 | <TheCard my-5> |
57 | 87 | <TheButton mx-auto mb-5 :loading @click="fetchData"> |
58 | | - {{ t('button.request') }} |
| 88 | + {{ t('button.axios-request') }} |
59 | 89 | </TheButton> |
60 | 90 | <ul v-if="todoList && todoList.length > 0" w-full my-5 h-30 overflow-y-auto> |
61 | 91 | <li v-for="item in todoList" :key="item.id"> |
|
0 commit comments