fix: fix vue-i18n types not defined
This commit is contained in:
1 parent
0e8371c830
commit
fe4ef304f7
3 files changed
+24
-15
No files matched your search
@@ -1,10 +1,13 @@
|
|||||||
<script setup lang="tsx">
|
<script setup lang="tsx">
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
|
import { useI18n } from 'vue-i18n'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route: any = useRoute()
|
const route: any = useRoute()
|
||||||
const titleKey: string = (route?.meta?.titleKey || 'title.main') as string
|
const titleKey: string = (route?.meta?.titleKey || 'title.main') as string
|
||||||
|
|
||||||
|
const { t } = useI18n()
|
||||||
|
|
||||||
const handleRoute = (path: string): void => {
|
const handleRoute = (path: string): void => {
|
||||||
router.push(path)
|
router.push(path)
|
||||||
}
|
}
|
||||||
@@ -15,7 +18,7 @@ const isCurrentRoute = (path: string): boolean => {
|
|||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<v-app-bar color="primary" density="compact">
|
<v-app-bar color="primary" density="compact">
|
||||||
<v-app-bar-title>{{ $t(titleKey) }}</v-app-bar-title>
|
<v-app-bar-title>{{ t(titleKey) }}</v-app-bar-title>
|
||||||
<template #append>
|
<template #append>
|
||||||
<v-btn
|
<v-btn
|
||||||
prepend-icon="mdi-home"
|
prepend-icon="mdi-home"
|
||||||
@@ -23,7 +26,7 @@ const isCurrentRoute = (path: string): boolean => {
|
|||||||
:class="{ active: isCurrentRoute('/') }"
|
:class="{ active: isCurrentRoute('/') }"
|
||||||
@click="handleRoute('/')"
|
@click="handleRoute('/')"
|
||||||
>
|
>
|
||||||
{{ $t('title.main') }}
|
{{ t('title.main') }}
|
||||||
</v-btn>
|
</v-btn>
|
||||||
<v-btn
|
<v-btn
|
||||||
prepend-icon="mdi-fit-to-screen-outline"
|
prepend-icon="mdi-fit-to-screen-outline"
|
||||||
@@ -31,7 +34,7 @@ const isCurrentRoute = (path: string): boolean => {
|
|||||||
:class="{ active: isCurrentRoute('/second') }"
|
:class="{ active: isCurrentRoute('/second') }"
|
||||||
@click="handleRoute('/second')"
|
@click="handleRoute('/second')"
|
||||||
>
|
>
|
||||||
{{ $t('title.second') }}
|
{{ t('title.second') }}
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</template>
|
</template>
|
||||||
</v-app-bar>
|
</v-app-bar>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { useCounterStore } from '@/renderer/store/counter'
|
|||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { onMounted, ref } from 'vue'
|
import { onMounted, ref } from 'vue'
|
||||||
|
|
||||||
const { locale, availableLocales } = useI18n()
|
const { t, locale, availableLocales } = useI18n()
|
||||||
const { counterIncrease } = useCounterStore()
|
const { counterIncrease } = useCounterStore()
|
||||||
const { counter } = storeToRefs(useCounterStore())
|
const { counter } = storeToRefs(useCounterStore())
|
||||||
const theme = useTheme()
|
const theme = useTheme()
|
||||||
@@ -68,13 +68,13 @@ const handleOpenFile = async () => {
|
|||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" md="7">
|
<v-col cols="12" md="7">
|
||||||
<h2 class="my-4">{{ $t('desc.welcome-title') }}</h2>
|
<h2 class="my-4">{{ t('desc.welcome-title') }}</h2>
|
||||||
<p>{{ $t('desc.welcome-desc') }}</p>
|
<p>{{ t('desc.welcome-desc') }}</p>
|
||||||
<p class="my-4">
|
<p class="my-4">
|
||||||
App Version: <strong>{{ appVersion }}</strong>
|
App Version: <strong>{{ appVersion }}</strong>
|
||||||
</p>
|
</p>
|
||||||
<p v-if="selectedFile">{{
|
<p v-if="selectedFile">{{
|
||||||
$t('desc.selected-file', {
|
t('desc.selected-file', {
|
||||||
filePath: selectedFile
|
filePath: selectedFile
|
||||||
})
|
})
|
||||||
}}</p>
|
}}</p>
|
||||||
@@ -83,7 +83,7 @@ const handleOpenFile = async () => {
|
|||||||
<v-btn icon color="primary" @click="handleChangeTheme">
|
<v-btn icon color="primary" @click="handleChangeTheme">
|
||||||
<v-icon icon="mdi-brightness-6" />
|
<v-icon icon="mdi-brightness-6" />
|
||||||
<v-tooltip activator="parent" location="bottom">
|
<v-tooltip activator="parent" location="bottom">
|
||||||
{{ $t('menu.change-theme') }}
|
{{ t('menu.change-theme') }}
|
||||||
</v-tooltip>
|
</v-tooltip>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-col>
|
</v-col>
|
||||||
@@ -92,7 +92,7 @@ const handleOpenFile = async () => {
|
|||||||
<v-btn data-testid="btn-counter" icon color="primary" @click="handleCountIncrease">
|
<v-btn data-testid="btn-counter" icon color="primary" @click="handleCountIncrease">
|
||||||
<v-icon icon="mdi-plus-circle" />
|
<v-icon icon="mdi-plus-circle" />
|
||||||
<v-tooltip activator="parent" location="bottom">
|
<v-tooltip activator="parent" location="bottom">
|
||||||
{{ $t('menu.increase-count') }}
|
{{ t('menu.increase-count') }}
|
||||||
</v-tooltip>
|
</v-tooltip>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-badge>
|
</v-badge>
|
||||||
@@ -101,7 +101,7 @@ const handleOpenFile = async () => {
|
|||||||
<v-btn icon color="primary" @click="handleOpenDocument">
|
<v-btn icon color="primary" @click="handleOpenDocument">
|
||||||
<v-icon icon="mdi-file-document" />
|
<v-icon icon="mdi-file-document" />
|
||||||
<v-tooltip activator="parent" location="bottom">
|
<v-tooltip activator="parent" location="bottom">
|
||||||
{{ $t('menu.documentation') }}
|
{{ t('menu.documentation') }}
|
||||||
</v-tooltip>
|
</v-tooltip>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-col>
|
</v-col>
|
||||||
@@ -109,7 +109,7 @@ const handleOpenFile = async () => {
|
|||||||
<v-btn icon color="primary" @click="handleOpenGitHub">
|
<v-btn icon color="primary" @click="handleOpenGitHub">
|
||||||
<v-icon icon="mdi-github" />
|
<v-icon icon="mdi-github" />
|
||||||
<v-tooltip activator="parent" location="bottom">
|
<v-tooltip activator="parent" location="bottom">
|
||||||
{{ $t('menu.github') }}
|
{{ t('menu.github') }}
|
||||||
</v-tooltip>
|
</v-tooltip>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-col>
|
</v-col>
|
||||||
@@ -117,7 +117,7 @@ const handleOpenFile = async () => {
|
|||||||
<v-btn icon color="primary" @click="handleOpenFile">
|
<v-btn icon color="primary" @click="handleOpenFile">
|
||||||
<v-icon icon="mdi-folder-open" />
|
<v-icon icon="mdi-folder-open" />
|
||||||
<v-tooltip activator="parent" location="bottom">
|
<v-tooltip activator="parent" location="bottom">
|
||||||
{{ $t('menu.open-file') }}
|
{{ t('menu.open-file') }}
|
||||||
</v-tooltip>
|
</v-tooltip>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-col>
|
</v-col>
|
||||||
@@ -126,11 +126,11 @@ const handleOpenFile = async () => {
|
|||||||
data-testid="select-language"
|
data-testid="select-language"
|
||||||
:model-value="locale"
|
:model-value="locale"
|
||||||
density="compact"
|
density="compact"
|
||||||
:label="$t('menu.change-language')"
|
:label="t('menu.change-language')"
|
||||||
:items="languages"
|
:items="languages"
|
||||||
@update:model-value="handleChangeLanguage"
|
@update:model-value="handleChangeLanguage"
|
||||||
>
|
>
|
||||||
{{ $t('menu.change-language') }}
|
{{ t('menu.change-language') }}
|
||||||
</v-select>
|
</v-select>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
|
<script setup lang="tsx">
|
||||||
|
import { useI18n } from 'vue-i18n'
|
||||||
|
|
||||||
|
const { t } = useI18n()
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<v-container>
|
<v-container>
|
||||||
<v-row no-gutters align="center" class="text-center">
|
<v-row no-gutters align="center" class="text-center">
|
||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
<v-icon icon="mdi-emoticon-cool-outline" size="250" color="#009f57" />
|
<v-icon icon="mdi-emoticon-cool-outline" size="250" color="#009f57" />
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" class="my-4">{{ $t('desc.second-desc') }}</v-col>
|
<v-col cols="12" class="my-4">{{ t('desc.second-desc') }}</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-container>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
Reference in new issue
Block a user