docs: add Playground link in navbar (#19278)

This commit is contained in:
Noblet Ouways
2024-12-15 03:27:28 +01:00
committed by GitHub
parent c39f3573f2
commit b3515ccd5d
2 changed files with 6 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
import { isExternal } from 'vitepress/dist/client/shared'
import { ensureLang } from '../utils/lang'
import navLocale from '../i18n/pages/sidebar.json'
@@ -12,7 +13,7 @@ function getNav() {
activeMatch?: string
}[] = Object.values(locales).map((item) => ({
...item,
link: `${ensureLang(lang)}${item.link}`,
link: `${isExternal(item.link) ? '' : ensureLang(lang)}${item.link}`,
}))
return [lang, item]

View File

@@ -13,5 +13,9 @@
"text": "Resource",
"link": "/resource/index",
"activeMatch": "/resource/"
},
{
"text": "Playground",
"link": "https://element-plus.run"
}
]