From 4a4b87707bd27418215ac8c52dc15fe6796085cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E5=AF=B8=E7=81=B0?= Date: Thu, 12 Dec 2024 15:15:52 +0800 Subject: [PATCH] feat(projects): :sparkles: add link to ElementPlus document (#20) --- build/plugins/router.ts | 1 + package.json | 2 +- src/locales/langs/en-us.ts | 1 + src/locales/langs/zh-cn.ts | 1 + src/router/elegant/transform.ts | 1 + src/router/routes/index.ts | 18 ++++++++++++++++-- src/typings/elegant-router.d.ts | 3 +++ 7 files changed, 24 insertions(+), 3 deletions(-) diff --git a/build/plugins/router.ts b/build/plugins/router.ts index 65460f9..784d275 100644 --- a/build/plugins/router.ts +++ b/build/plugins/router.ts @@ -20,6 +20,7 @@ export function setupElegantRouter() { 'document_unocss', 'document_naive', 'document_antd', + 'document_element-plus', 'document_alova' ] }, diff --git a/package.json b/package.json index eb1b722..6aec83f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@sa/elp", "type": "module", "version": "1.3.8", - "description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。", + "description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、ElementPlus and UnoCSS. 一个基于Vue3、Vite3、TypeScript、ElementPlus and UnoCSS的清新优雅的中后台模版。", "author": { "name": "Soybean", "email": "soybeanjs@outlook.com", diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index 73bd10a..da74dc9 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -168,6 +168,7 @@ const local: App.I18n.Schema = { document_unocss: 'UnoCSS Document', document_naive: 'Naive UI Document', document_antd: 'Ant Design Vue Document', + 'document_element-plus': 'Element Plus Document', document_alova: 'Alova Document', 'user-center': 'User Center', about: 'About', diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 2ff6b16..1ee8fce 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -168,6 +168,7 @@ const local: App.I18n.Schema = { document_unocss: 'UnoCSS文档', document_naive: 'Naive UI文档', document_antd: 'Ant Design Vue文档', + 'document_element-plus': 'Element Plus文档', document_alova: 'Alova文档', 'user-center': '个人中心', about: '关于', diff --git a/src/router/elegant/transform.ts b/src/router/elegant/transform.ts index a67a34f..3aaafbf 100644 --- a/src/router/elegant/transform.ts +++ b/src/router/elegant/transform.ts @@ -175,6 +175,7 @@ const routeMap: RouteMap = { "document_unocss": "/document/unocss", "document_naive": "/document/naive", "document_antd": "/document/antd", + "document_element-plus": "/document/element-plus", "document_alova": "/document/alova", "403": "/403", "404": "/404", diff --git a/src/router/routes/index.ts b/src/router/routes/index.ts index 952cbfc..bfa55a7 100644 --- a/src/router/routes/index.ts +++ b/src/router/routes/index.ts @@ -88,7 +88,21 @@ const customRoutes: CustomRoute[] = [ title: 'document_naive', i18nKey: 'route.document_naive', order: 6, - icon: 'logos:NativeUI' + icon: 'logos:naiveui' + } + }, + { + name: 'document_element-plus', + path: '/document/element-plus', + component: 'view.iframe-page', + props: { + url: 'https://element-plus.org/zh-CN/' + }, + meta: { + title: 'document_element-plus', + i18nKey: 'route.document_element-plus', + order: 7, + icon: 'ep:element-plus' } }, { @@ -101,7 +115,7 @@ const customRoutes: CustomRoute[] = [ meta: { title: 'document_alova', i18nKey: 'route.document_alova', - order: 7, + order: 8, localIcon: 'alova' } }, diff --git a/src/typings/elegant-router.d.ts b/src/typings/elegant-router.d.ts index 4e3e22a..42d384e 100644 --- a/src/typings/elegant-router.d.ts +++ b/src/typings/elegant-router.d.ts @@ -29,6 +29,7 @@ declare module "@elegant-router/types" { "document_unocss": "/document/unocss"; "document_naive": "/document/naive"; "document_antd": "/document/antd"; + "document_element-plus": "/document/element-plus"; "document_alova": "/document/alova"; "403": "/403"; "404": "/404"; @@ -114,6 +115,7 @@ declare module "@elegant-router/types" { | "document_unocss" | "document_naive" | "document_antd" + | "document_element-plus" | "document_alova" >; @@ -219,6 +221,7 @@ declare module "@elegant-router/types" { | "document_unocss" | "document_naive" | "document_antd" + | "document_element-plus" | "document_alova" >;