From 3d9cd8013de6b51c27e2c906117636780d6c8695 Mon Sep 17 00:00:00 2001 From: MTrun <1262327911@qq.com> Date: Sat, 8 Jan 2022 09:31:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E4=B8=8D=E4=BC=9A=E5=90=8C=E6=AD=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UserInfo/components/SystemSet/index.vue | 2 +- src/components/UserInfo/index.vue | 26 +++++++++++++------ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/components/UserInfo/components/SystemSet/index.vue b/src/components/UserInfo/components/SystemSet/index.vue index 1448c560..8cf5cff3 100644 --- a/src/components/UserInfo/components/SystemSet/index.vue +++ b/src/components/UserInfo/components/SystemSet/index.vue @@ -54,7 +54,7 @@ const langStore = useLangStore() const list = reactive<ListType[]>([ { key: 'lang', - value: false, + value: langStore.getReload, type: 'switch', name: '切换语言', desc: '切换语言是否重新加载页面', diff --git a/src/components/UserInfo/index.vue b/src/components/UserInfo/index.vue index a7fad806..704ebb9a 100644 --- a/src/components/UserInfo/index.vue +++ b/src/components/UserInfo/index.vue @@ -19,11 +19,11 @@ </n-dropdown> <!-- 系统设置 model --> - <SystemSet v-model:modelShow="modelShow"/> + <SystemSet v-model:modelShow="modelShow" /> </template> <script lang="ts" setup> -import { h, ref, reactive } from 'vue' +import { h, ref, watchEffect } from 'vue' import { NAvatar, NText } from 'naive-ui' import { renderIcon } from '@/utils' import { openDoc, logout } from '@/utils' @@ -68,8 +68,9 @@ const renderUserInfo = () => { ] ) } +const options = ref() -const options = reactive([ +const init = (doc: string, contact: string, sysSet: string, logout: string) => [ { label: '我的信息', key: 'info', @@ -81,17 +82,17 @@ const options = reactive([ key: 'd1' }, { - label: t('global.doc'), + label: doc, key: 'doc', icon: renderIcon(DocumentTextIcon) }, { - label: t('global.contact'), + label: contact, key: 'contact', icon: renderIcon(ChatboxEllipsesIcon) }, { - label: t('global.sys_set'), + label: sysSet, key: 'sysSet', icon: renderIcon(SettingsSharpIcon) }, @@ -100,11 +101,20 @@ const options = reactive([ key: 'd3' }, { - label: t('global.logout'), + label: logout, key: 'logout', icon: renderIcon(LogOutOutlineIcon) } -]) +] + +watchEffect(() => { + options.value = init( + t('global.doc'), + t('global.contact'), + t('global.sys_set'), + t('global.logout') + ) +}) // 图片渲染错误 const errorHandle = (e: Event) => {