diff --git a/src/layout/components/PageHeader.vue b/src/layout/components/PageHeader.vue index 1ea2f04..9d54e93 100644 --- a/src/layout/components/PageHeader.vue +++ b/src/layout/components/PageHeader.vue @@ -20,23 +20,32 @@ @@ -47,17 +56,34 @@ import {Message} from '@element-plus/icons-vue' import {useI18n} from "vue-i18n"; import {ref} from 'vue'; import {useRoute} from "vue-router"; +import router from "@/router/index.js"; const route = useRoute(); const {locale, t} = useI18n(); + function changeLanguage(lang) { locale.value = lang localStorage.setItem('locale', lang) } + const isLogin = ref(false); const username = ref('admin'); +const unReadCount = ref(2); isLogin.value = true; +const commands = { + toPersonal: () => { + router.push('/personal') + }, + toLogout: () => { + console.log('退出') + } +} + +function handleCommand(command) { + commands[command] && commands[command]() +} +