|
|
@@ -1,20 +1,20 @@
|
|
|
<template>
|
|
|
<app-view class="setting-theme" background="primary">
|
|
|
<template #header>
|
|
|
- <app-navbar title="深色模式" />
|
|
|
+ <app-navbar :title="t('digital.dark')" />
|
|
|
</template>
|
|
|
<CellGroup>
|
|
|
- <Cell title="跟随系统" clickable @click="onClick(AppTheme.Default)">
|
|
|
+ <Cell :title="t('digital.system')" clickable @click="onClick(AppTheme.Default)">
|
|
|
<template #right-icon v-if="globalStore.appTheme === AppTheme.Default">
|
|
|
<img :src="'./img/icons/success.svg'" />
|
|
|
</template>
|
|
|
</Cell>
|
|
|
- <Cell title="浅色模式" clickable @click="onClick(AppTheme.Light)">
|
|
|
+ <Cell :title="t('digital.light')" clickable @click="onClick(AppTheme.Light)">
|
|
|
<template #right-icon v-if="globalStore.appTheme === AppTheme.Light">
|
|
|
<img :src="'./img/icons/success.svg'" />
|
|
|
</template>
|
|
|
</Cell>
|
|
|
- <Cell title="深色模式" clickable @click="onClick(AppTheme.Dark)">
|
|
|
+ <Cell :title="t('digital.dark')" clickable @click="onClick(AppTheme.Dark)">
|
|
|
<template #right-icon v-if="globalStore.appTheme === AppTheme.Dark">
|
|
|
<img :src="'./img/icons/success.svg'" />
|
|
|
</template>
|
|
|
@@ -27,11 +27,13 @@
|
|
|
import { Cell, CellGroup } from 'vant'
|
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
|
import { AppTheme } from '@/constants/theme'
|
|
|
-import { useGlobalStore } from '@/stores'
|
|
|
+import { i18n, useGlobalStore } from '@/stores'
|
|
|
|
|
|
const { routerBack } = useNavigation()
|
|
|
const globalStore = useGlobalStore()
|
|
|
|
|
|
+const { global: { t } } = i18n
|
|
|
+
|
|
|
const onClick = (value: AppTheme) => {
|
|
|
globalStore.setTheme(value)
|
|
|
routerBack()
|