mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-02-16 19:22:27 +08:00
1.0发布,Fixes Bug,以及新增 ProTable组件
This commit is contained in:
44
src/router/modules/comp.ts
Normal file
44
src/router/modules/comp.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { RouteRecordRaw } from 'vue-router'
|
||||
import { Layout } from '@/router/constant';
|
||||
import { ProfileOutlined } from '@vicons/antd'
|
||||
import { renderIcon } from '@/utils/index'
|
||||
|
||||
|
||||
const routeName = 'comp'
|
||||
|
||||
/**
|
||||
* @param name 路由名称, 必须设置,且不能重名
|
||||
* @param meta 路由元信息(路由附带扩展信息)
|
||||
* @param redirect 重定向地址, 访问这个路由时,自定进行重定向
|
||||
* @param meta.disabled 禁用整个菜单
|
||||
* @param meta.title 菜单名称
|
||||
* @param meta.icon 菜单图标
|
||||
* @param meta.keepAlive 缓存该路由
|
||||
* @param meta.sort 排序越小越排前
|
||||
*
|
||||
* */
|
||||
const routes: Array<RouteRecordRaw> = [
|
||||
{
|
||||
path: '/comp',
|
||||
name: routeName,
|
||||
redirect: '/comp/console',
|
||||
component: Layout,
|
||||
meta: {
|
||||
title: '组件',
|
||||
icon: renderIcon(ProfileOutlined),
|
||||
sort: 1
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'table',
|
||||
name: `${ routeName }_table`,
|
||||
meta: {
|
||||
title: '基础表格',
|
||||
},
|
||||
component: () => import('@/views/comp/table/list.vue')
|
||||
}
|
||||
],
|
||||
}
|
||||
]
|
||||
|
||||
export default routes
|
||||
@@ -1,13 +1,7 @@
|
||||
import { h } from 'vue'
|
||||
import { NIcon } from 'naive-ui'
|
||||
import { RouteRecordRaw } from 'vue-router'
|
||||
import { Layout } from '@/router/constant';
|
||||
import { MainView } from '@/layout/components/Main'
|
||||
import { DashboardOutlined } from '@vicons/antd'
|
||||
|
||||
function renderIcon(icon) {
|
||||
return () => h(NIcon, null, { default: () => h(icon) })
|
||||
}
|
||||
import { renderIcon } from '@/utils/index'
|
||||
|
||||
const routeName = 'dashboard'
|
||||
|
||||
@@ -19,7 +13,7 @@ const routeName = 'dashboard'
|
||||
* @param meta.title 菜单名称
|
||||
* @param meta.icon 菜单图标
|
||||
* @param meta.keepAlive 缓存该路由
|
||||
*
|
||||
* @param meta.sort 排序越小越排前
|
||||
* */
|
||||
const routes: Array<RouteRecordRaw> = [
|
||||
{
|
||||
@@ -30,7 +24,8 @@ const routes: Array<RouteRecordRaw> = [
|
||||
meta: {
|
||||
title: 'Dashboard',
|
||||
icon: renderIcon(DashboardOutlined),
|
||||
permission: ['dashboard_console', 'dashboard_console', 'dashboard_workplace']
|
||||
permission: ['dashboard_console', 'dashboard_console', 'dashboard_workplace'],
|
||||
sort: 0
|
||||
},
|
||||
children: [
|
||||
{
|
||||
@@ -56,7 +51,7 @@ const routes: Array<RouteRecordRaw> = [
|
||||
name: `${ routeName }_workplace`,
|
||||
meta: {
|
||||
title: '工作台',
|
||||
keepAlive:true,
|
||||
keepAlive: true,
|
||||
permission: ['dashboard_workplace']
|
||||
},
|
||||
component: () => import('@/views/dashboard/workplace/workplace.vue')
|
||||
|
||||
Reference in New Issue
Block a user