mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 11:35:58 +08:00
feat(breadcrumb): add breadcrumb demo #143
This commit is contained in:
@@ -71,8 +71,10 @@ export async function getShallowMenus(): Promise<Menu[]> {
|
||||
export async function getChildrenMenus(parentPath: string) {
|
||||
const menus = await getAsyncMenus();
|
||||
const parent = menus.find((item) => item.path === parentPath);
|
||||
if (!parent) return [] as Menu[];
|
||||
return parent.children;
|
||||
if (!parent || !parent.children) return [] as Menu[];
|
||||
const routes = router.getRoutes();
|
||||
|
||||
return !isBackMode() ? filter(parent.children, basicFilter(routes)) : parent.children;
|
||||
}
|
||||
|
||||
// 通用过滤方法
|
||||
|
@@ -151,9 +151,6 @@ const menu: MenuModule = {
|
||||
{
|
||||
path: 'loading',
|
||||
name: t('routes.demo.comp.loading'),
|
||||
tag: {
|
||||
content: 'new',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'tree',
|
||||
@@ -176,6 +173,9 @@ const menu: MenuModule = {
|
||||
{
|
||||
name: t('routes.demo.editor.editor'),
|
||||
path: 'editor',
|
||||
tag: {
|
||||
content: 'new',
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'markdown',
|
||||
|
@@ -19,6 +19,7 @@ const menu: MenuModule = {
|
||||
path: 'tabs',
|
||||
name: t('routes.demo.feat.tabs'),
|
||||
},
|
||||
|
||||
{
|
||||
path: 'context-menu',
|
||||
name: t('routes.demo.feat.contextMenu'),
|
||||
@@ -85,6 +86,27 @@ const menu: MenuModule = {
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: t('routes.demo.feat.breadcrumb'),
|
||||
path: 'breadcrumb',
|
||||
tag: {
|
||||
content: 'new',
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'flat',
|
||||
name: t('routes.demo.feat.breadcrumbFlat'),
|
||||
},
|
||||
{
|
||||
path: 'flatDetail',
|
||||
name: t('routes.demo.feat.breadcrumbFlatDetail'),
|
||||
},
|
||||
{
|
||||
path: 'children',
|
||||
name: t('routes.demo.feat.breadcrumbChildrenDetail'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'testTab',
|
||||
name: t('routes.demo.feat.tab'),
|
||||
|
@@ -7,14 +7,14 @@ const menu: MenuModule = {
|
||||
name: t('routes.demo.iframe.frame'),
|
||||
path: '/frame',
|
||||
children: [
|
||||
{
|
||||
path: 'antv',
|
||||
name: t('routes.demo.iframe.antv'),
|
||||
},
|
||||
{
|
||||
path: 'doc',
|
||||
name: t('routes.demo.iframe.doc'),
|
||||
},
|
||||
{
|
||||
path: 'antv',
|
||||
name: t('routes.demo.iframe.antv'),
|
||||
},
|
||||
{
|
||||
path: 'https://vvbin.cn/doc-next/',
|
||||
name: t('routes.demo.iframe.docExternal'),
|
||||
|
@@ -6,9 +6,6 @@ const menu: MenuModule = {
|
||||
menu: {
|
||||
name: t('routes.demo.level.level'),
|
||||
path: '/level',
|
||||
tag: {
|
||||
dot: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'menu1',
|
||||
|
@@ -6,9 +6,7 @@ const menu: MenuModule = {
|
||||
menu: {
|
||||
name: t('routes.demo.page.page'),
|
||||
path: '/page-demo',
|
||||
tag: {
|
||||
dot: true,
|
||||
},
|
||||
|
||||
children: [
|
||||
{
|
||||
path: 'form',
|
||||
@@ -102,9 +100,6 @@ const menu: MenuModule = {
|
||||
{
|
||||
path: 'list',
|
||||
name: t('routes.demo.page.list'),
|
||||
tag: {
|
||||
content: 'new',
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'basic',
|
||||
|
Reference in New Issue
Block a user