Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-fe
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poc
poc-fe
Commits
1348de9d
Commit
1348de9d
authored
Nov 08, 2024
by
tyyin lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(多语言): 默认语言切换
parent
55d2c127
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
sidebar.vue
src/layout/components/sidebar/sidebar.vue
+8
-6
index.ts
src/locales/index.ts
+2
-2
No files found.
src/layout/components/sidebar/sidebar.vue
View file @
1348de9d
...
...
@@ -6,7 +6,7 @@ import { Plus } from '@icon-park/vue-next'
import
type
{
MenuOption
}
from
'naive-ui'
import
CustomIcon
from
'@/components/custom-icon/custom-icon.vue'
import
{
useUserStore
}
from
'@/store/modules/user'
import
LanguageSetting
from
'@/components/language-setting/language-setting.vue'
//
import LanguageSetting from '@/components/language-setting/language-setting.vue'
const
{
t
}
=
useI18n
()
...
...
@@ -117,16 +117,18 @@ function handleMenuValueChange(key: string) {
</n-scrollbar>
</div>
<div
class=
"mb-[20px] mt-6
px-[12px]
"
>
<div
class=
"mb-[20px] mt-6"
>
<div>
<NDropdown
v-if=
"userStore.isLogin"
trigger=
"click"
placement=
"top
-start
"
placement=
"top"
:options=
"avatarOptions"
@
select=
"handleDropdownSelect"
>
<div
class=
"flex h-full cursor-pointer items-center"
>
<div
class=
"flex h-full cursor-pointer items-center rounded-[6px] px-[12px] py-[4px] transition hover:bg-[#F3F3F5]"
>
<NAvatar
round
:size=
"40"
object-fit=
"cover"
:src=
"userStore.userInfo.avatarUrl || defaultAvatar"
/>
<div
class=
"ml-3 line-clamp-1 max-w-[140px] select-none break-all text-base"
>
...
...
@@ -142,9 +144,9 @@ function handleMenuValueChange(key: string) {
</div>
</div>
<div
class=
"mt-[10px]"
>
<
!--
<
div
class=
"mt-[10px]"
>
<LanguageSetting
arrow-direction=
"top"
/>
</div>
</div>
-->
</div>
</div>
</
template
>
...
...
src/locales/index.ts
View file @
1348de9d
...
...
@@ -3,12 +3,12 @@ import { createI18n } from 'vue-i18n'
import
messages
from
'./messages'
import
{
ss
}
from
'@/utils/storage'
export
const
defaultLocale
=
'zh-
CN
'
export
const
defaultLocale
=
'zh-
HK
'
const
i18n
=
createI18n
<
[
I18n
.
Schema
],
I18n
.
LangType
>
({
legacy
:
false
,
locale
:
ss
.
get
(
'i18nextLng'
)
||
defaultLocale
,
fallbackLocale
:
'zh-
HK
'
,
fallbackLocale
:
'zh-
CN
'
,
messages
,
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment