Skip to content

Commit cde3fb7

Browse files
committed
fix(view): update router And fix Breadcrumb
1 parent b3c5f2e commit cde3fb7

File tree

2 files changed

+1
-238
lines changed

2 files changed

+1
-238
lines changed

admin/src/components/Breadcrumb/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default {
3333
const first = matched[0]
3434
3535
if (!this.isDashboard(first)) {
36-
matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched)
36+
matched = [{ path: '/admin', meta: { title: 'Dashboard' }}].concat(matched)
3737
}
3838
3939
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)

admin/src/router/index.js

Lines changed: 0 additions & 237 deletions
Original file line numberDiff line numberDiff line change
@@ -229,249 +229,12 @@ const routeBase = [
229229
]
230230

231231
const routeTest = [
232-
{
233-
path: '/example',
234-
component: Layout,
235-
redirect: '/example/table',
236-
name: 'Example',
237-
meta: { title: 'Example', icon: 'example' },
238-
children: [
239-
{
240-
path: 'table',
241-
name: 'Table',
242-
component: () => import('@/views/table/index'),
243-
meta: { title: 'Table', icon: 'table' }
244-
},
245-
{
246-
path: 'tree',
247-
name: 'Tree',
248-
component: () => import('@/views/tree/index'),
249-
meta: { title: 'Tree', icon: 'tree' }
250-
}
251-
]
252-
},
253-
254-
{
255-
path: '/form',
256-
component: Layout,
257-
children: [
258-
{
259-
path: 'index',
260-
name: 'Form',
261-
component: () => import('@/views/form/index'),
262-
meta: { title: 'Form', icon: 'form' }
263-
}
264-
]
265-
},
266-
267-
{
268-
path: '/nested',
269-
component: Layout,
270-
redirect: '/nested/menu1',
271-
name: 'Nested',
272-
meta: {
273-
title: 'Nested',
274-
icon: 'nested'
275-
},
276-
children: [
277-
{
278-
path: 'menu1',
279-
component: () => import('@/views/nested/menu1/index'), // Parent router-view
280-
name: 'Menu1',
281-
meta: { title: 'Menu1' },
282-
children: [
283-
{
284-
path: 'menu1-1',
285-
component: () => import('@/views/nested/menu1/menu1-1'),
286-
name: 'Menu1-1',
287-
meta: { title: 'Menu1-1' }
288-
},
289-
{
290-
path: 'menu1-2',
291-
component: () => import('@/views/nested/menu1/menu1-2'),
292-
name: 'Menu1-2',
293-
meta: { title: 'Menu1-2' },
294-
children: [
295-
{
296-
path: 'menu1-2-1',
297-
component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'),
298-
name: 'Menu1-2-1',
299-
meta: { title: 'Menu1-2-1' }
300-
},
301-
{
302-
path: 'menu1-2-2',
303-
component: () => import('@/views/nested/menu1/menu1-2/menu1-2-2'),
304-
name: 'Menu1-2-2',
305-
meta: { title: 'Menu1-2-2' }
306-
}
307-
]
308-
},
309-
{
310-
path: 'menu1-3',
311-
component: () => import('@/views/nested/menu1/menu1-3'),
312-
name: 'Menu1-3',
313-
meta: { title: 'Menu1-3' }
314-
}
315-
]
316-
},
317-
{
318-
path: 'menu2',
319-
component: () => import('@/views/nested/menu2/index'),
320-
meta: { title: 'menu2' }
321-
}
322-
]
323-
},
324-
325-
{
326-
path: 'external-link',
327-
component: Layout,
328-
children: [
329-
{
330-
path: 'https://panjiachen.github.io/vue-element-admin-site/#/',
331-
meta: { title: 'External Link', icon: 'link' }
332-
}
333-
]
334-
},
335-
336232
// 404 page must be placed at the end !!!
337233
{ path: '*', redirect: '/404', hidden: true }
338234
]
339235

340236
export const constantRouterMap = [...routeAdmin, ...routeSuper, ...routeBase, ...routeTest]
341237

342-
export const constantRoutes = [
343-
{
344-
path: '/login',
345-
component: () => import('@/views/login/index'),
346-
hidden: true
347-
},
348-
349-
{
350-
path: '/404',
351-
component: () => import('@/views/404'),
352-
hidden: true
353-
},
354-
355-
{
356-
path: '/',
357-
component: Layout,
358-
redirect: '/dashboard',
359-
children: [{
360-
path: 'dashboard',
361-
name: 'Dashboard',
362-
component: () => import('@/views/dashboard/index'),
363-
meta: { title: 'Dashboard', icon: 'dashboard' }
364-
}]
365-
},
366-
367-
{
368-
path: '/example',
369-
component: Layout,
370-
redirect: '/example/table',
371-
name: 'Example',
372-
meta: { title: 'Example', icon: 'example' },
373-
children: [
374-
{
375-
path: 'table',
376-
name: 'Table',
377-
component: () => import('@/views/table/index'),
378-
meta: { title: 'Table', icon: 'table' }
379-
},
380-
{
381-
path: 'tree',
382-
name: 'Tree',
383-
component: () => import('@/views/tree/index'),
384-
meta: { title: 'Tree', icon: 'tree' }
385-
}
386-
]
387-
},
388-
389-
{
390-
path: '/form',
391-
component: Layout,
392-
children: [
393-
{
394-
path: 'index',
395-
name: 'Form',
396-
component: () => import('@/views/form/index'),
397-
meta: { title: 'Form', icon: 'form' }
398-
}
399-
]
400-
},
401-
402-
{
403-
path: '/nested',
404-
component: Layout,
405-
redirect: '/nested/menu1',
406-
name: 'Nested',
407-
meta: {
408-
title: 'Nested',
409-
icon: 'nested'
410-
},
411-
children: [
412-
{
413-
path: 'menu1',
414-
component: () => import('@/views/nested/menu1/index'), // Parent router-view
415-
name: 'Menu1',
416-
meta: { title: 'Menu1' },
417-
children: [
418-
{
419-
path: 'menu1-1',
420-
component: () => import('@/views/nested/menu1/menu1-1'),
421-
name: 'Menu1-1',
422-
meta: { title: 'Menu1-1' }
423-
},
424-
{
425-
path: 'menu1-2',
426-
component: () => import('@/views/nested/menu1/menu1-2'),
427-
name: 'Menu1-2',
428-
meta: { title: 'Menu1-2' },
429-
children: [
430-
{
431-
path: 'menu1-2-1',
432-
component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'),
433-
name: 'Menu1-2-1',
434-
meta: { title: 'Menu1-2-1' }
435-
},
436-
{
437-
path: 'menu1-2-2',
438-
component: () => import('@/views/nested/menu1/menu1-2/menu1-2-2'),
439-
name: 'Menu1-2-2',
440-
meta: { title: 'Menu1-2-2' }
441-
}
442-
]
443-
},
444-
{
445-
path: 'menu1-3',
446-
component: () => import('@/views/nested/menu1/menu1-3'),
447-
name: 'Menu1-3',
448-
meta: { title: 'Menu1-3' }
449-
}
450-
]
451-
},
452-
{
453-
path: 'menu2',
454-
component: () => import('@/views/nested/menu2/index'),
455-
meta: { title: 'menu2' }
456-
}
457-
]
458-
},
459-
460-
{
461-
path: 'external-link',
462-
component: Layout,
463-
children: [
464-
{
465-
path: 'https://panjiachen.github.io/vue-element-admin-site/#/',
466-
meta: { title: 'External Link', icon: 'link' }
467-
}
468-
]
469-
},
470-
471-
// 404 page must be placed at the end !!!
472-
{ path: '*', redirect: '/404', hidden: true }
473-
]
474-
475238
const createRouter = () => new Router({
476239
// mode: 'history', // require service support
477240
scrollBehavior: () => ({ y: 0 }),

0 commit comments

Comments
 (0)