docs: update README.md

fix: fix useScrollTo not work bug

feat: add doucment link
This commit is contained in:
陈凯龙 2022-02-22 11:27:29 +08:00
parent be94a09f4c
commit 53201ae97a
11 changed files with 58 additions and 6 deletions

View File

@ -29,6 +29,7 @@ If you need a basic template, please switch to the `tempalte` branch. `Tempalte`
## Preview
- [vue-element-plus-admin](https://element-plus-admin.cn/) - Full version of the github site
- [vue-element-plus-admin](https://kailong110120130.gitee.io/vue-element-plus-admin) - Full version of the gitee site
account: **admin/admin test/test**
@ -38,7 +39,7 @@ account: **admin/admin test/test**
## Documentation
[Document](https://element-plus-admin.cn/)
[Document Github](https://element-plus-admin.cn/) [Document Gitee](https://kailong110120130.gitee.io/vue-element-plus-admin-doc)
## Preparation

View File

@ -29,6 +29,7 @@ vue-element-plus-admin 的定位是后台集成方案,不太适合当基础模
## 预览
- [vue-element-plus-admin](https://element-plus-admin.cn/) - 完整版 github 站点
- [vue-element-plus-admin](https://kailong110120130.gitee.io/vue-element-plus-admin) - 完整版 gitee 站点
帐号:**admin/admin test/test**
@ -38,7 +39,7 @@ vue-element-plus-admin 的定位是后台集成方案,不太适合当基础模
## 文档
[文档地址](https://element-plus-admin-doc.cn/)
[文档地址 Github](https://element-plus-admin-doc.cn/) [文档地址 Gitee](https://kailong110120130.gitee.io/vue-element-plus-admin-doc)
## 前序准备

View File

@ -37,6 +37,22 @@ const adminList = [
}
]
},
{
path: '/external-link',
component: '#',
meta: {},
name: 'ExternalLink',
children: [
{
path: 'https://element-plus-admin-doc.cn/',
name: 'DocumentLink',
meta: {
title: 'router.document',
icon: 'clarity:document-solid'
}
}
]
},
{
path: '/guide',
component: '#',
@ -414,6 +430,8 @@ const testList: string[] = [
'/dashboard',
'/dashboard/analysis',
'/dashboard/workplace',
'external-link',
'https://element-plus-admin-doc.cn/',
'/guide',
'/guide/index',
'/components',

View File

@ -61,6 +61,7 @@ export default defineComponent({
props.menuSelect(index)
}
//
console.log(index)
if (isUrl(index)) {
window.open(index)
} else {

View File

@ -15,7 +15,6 @@ export const useRenderMenuItem = (
const meta = (v.meta ?? {}) as RouteMeta
if (!meta.hidden) {
const { oneShowingChild, onlyOneChild } = hasOneShowingChild(v.children, v)
const fullPath = isUrl(v.path)
? v.path
: getAllParentPath<AppRouteRecordRaw>(allRouters, v.path).join('/')

View File

@ -11,6 +11,7 @@ import { pathResolve } from '@/utils/routerHelper'
import { cloneDeep } from 'lodash-es'
import { filterMenusPath, initTabMap, tabPathMap } from './helper'
import { useDesign } from '@/hooks/web/useDesign'
import { isUrl } from '@/utils/is'
const { getPrefixCls, variables } = useDesign()
@ -72,6 +73,10 @@ export default defineComponent({
// tab
const tabClick = (item: AppRouteRecordRaw) => {
if (isUrl(item.path)) {
window.open(item.path)
return
}
tabActive.value = item.children ? item.path : item.path.split('/')[0]
if (item.children) {
showMenu.value = !unref(showMenu)

View File

@ -6,6 +6,9 @@ import { resetRouter } from '@/router'
import { useRouter } from 'vue-router'
import { loginOutApi } from '@/api/login'
import { useDesign } from '@/hooks/web/useDesign'
import { useTagsViewStore } from '@/store/modules/tagsView'
const tagsViewStore = useTagsViewStore()
const { getPrefixCls } = useDesign()
@ -27,12 +30,17 @@ const loginOut = () => {
const res = await loginOutApi().catch(() => {})
if (res) {
wsCache.clear()
tagsViewStore.delAllViews()
resetRouter() //
replace('/login')
}
})
.catch(() => {})
}
const toDocument = () => {
window.open('https://element-plus-admin-doc.cn/')
}
</script>
<template>
@ -48,7 +56,7 @@ const loginOut = () => {
<template #dropdown>
<ElDropdownMenu>
<ElDropdownItem>
<div>{{ t('common.document') }}</div>
<div @click="toDocument">{{ t('common.document') }}</div>
</ElDropdownItem>
<ElDropdownItem divided>
<div @click="loginOut">{{ t('common.loginOut') }}</div>

View File

@ -129,7 +129,8 @@ export default {
errorPage: 'Error page',
authorization: 'Authorization',
user: 'User management',
role: 'Role management'
role: 'Role management',
document: 'Document'
},
analysis: {
newUser: 'New user',

View File

@ -129,7 +129,8 @@ export default {
errorPage: '错误页面',
authorization: '权限管理',
user: '用户管理',
role: '角色管理'
role: '角色管理',
document: '文档'
},
analysis: {
newUser: '新增用户',

View File

@ -87,6 +87,22 @@ export const asyncRouterMap: AppRouteRecordRaw[] = [
}
]
},
{
path: '/external-link',
component: Layout,
meta: {},
name: 'ExternalLink',
children: [
{
path: 'https://element-plus-admin-doc.cn/',
name: 'DocumentLink',
meta: {
title: t('router.document'),
icon: 'clarity:document-solid'
}
}
]
},
{
path: '/guide',
component: Layout,

View File

@ -114,6 +114,7 @@ export const generateRoutesFn2 = (routes: AppCustomRouteRecordRaw[]): AppRouteRe
}
export const pathResolve = (parentPath: string, path: string) => {
if (isUrl(path)) return path
const childPath = path.startsWith('/') || !path ? path : `/${path}`
return `${parentPath}${childPath}`.replace(/\/\//g, '/')
}