feat: 回退页面完善

This commit is contained in:
vben
2024-06-08 20:14:04 +08:00
parent 7bcd7746ca
commit 1d6b1f4926
31 changed files with 791 additions and 201 deletions

View File

@@ -0,0 +1,49 @@
import type { RouteRecordRaw } from 'vue-router';
import { BasicLayout } from '@/layouts';
import { $t } from '@vben/locales/helper';
const routes: RouteRecordRaw[] = [
{
component: BasicLayout,
meta: {
icon: 'mdi:lightbulb-error-outline',
title: $t('page.fallback.page'),
},
name: 'FallbackLayout',
path: '/fallback',
redirect: '/fallback/403',
children: [
{
name: 'Fallback403',
path: '403',
component: () => import('@/views/_essential/fallback/forbidden.vue'),
meta: {
icon: 'mdi:do-not-disturb-alt',
title: '403',
},
},
{
name: 'Fallback404',
path: '404',
component: () => import('@/views/_essential/fallback/not-found.vue'),
meta: {
icon: 'mdi:table-off',
title: '404',
},
},
{
name: 'Fallback500',
path: '500',
component: () =>
import('@/views/_essential/fallback/internal-error.vue'),
meta: {
icon: 'mdi:server-network-off',
title: '500',
},
},
],
},
];
export default routes;

View File

@@ -0,0 +1,30 @@
import type { RouteRecordRaw } from 'vue-router';
import { BasicLayout } from '@/layouts';
const routes: RouteRecordRaw[] = [
{
component: BasicLayout,
meta: {
hideChildrenInMenu: true,
order: -1,
title: '首页',
},
name: 'Home',
path: '/',
redirect: '/welcome',
children: [
{
name: 'Welcome',
path: '/welcome',
component: () => import('@/views/dashboard/index.vue'),
meta: {
affixTab: true,
title: 'Welcome',
},
},
],
},
];
export default routes;

View File

@@ -0,0 +1,85 @@
import type { RouteRecordRaw } from 'vue-router';
import { BasicLayout } from '@/layouts';
import { $t } from '@vben/locales/helper';
const routes: RouteRecordRaw[] = [
{
component: BasicLayout,
meta: {
icon: 'ic:round-menu',
keepAlive: true,
order: 1000,
title: $t('page.nested.page'),
},
name: 'Nested',
path: '/nested',
redirect: '/nested/menu1',
children: [
{
name: 'Menu1',
path: 'menu1',
component: () => import('@/views/nested/menu-1.vue'),
meta: {
icon: 'ic:round-menu',
keepAlive: true,
title: $t('page.nested.menu1'),
},
},
{
name: 'Menu2',
path: 'menu2',
component: () => import('@/views/nested/menu-2.vue'),
meta: {
icon: 'ic:round-menu',
keepAlive: true,
title: $t('page.nested.menu2'),
},
},
{
name: 'Menu3',
path: 'menu3',
meta: {
icon: 'ic:round-menu',
title: $t('page.nested.menu3'),
},
redirect: '/nested/menu3/menu3-1',
children: [
{
name: 'Menu31',
path: 'menu3-1',
component: () => import('@/views/nested/menu-3-1.vue'),
meta: {
icon: 'ic:round-menu',
keepAlive: true,
title: $t('page.nested.menu31'),
},
},
{
name: 'Menu32',
path: 'menu3-2',
meta: {
icon: 'ic:round-menu',
title: $t('page.nested.menu32'),
},
redirect: '/nested/menu3/menu3-2/menu3-2-1',
children: [
{
name: 'Menu321',
path: 'menu3-2-1',
component: () => import('@/views/nested/menu-3-2-1.vue'),
meta: {
icon: 'ic:round-menu',
keepAlive: true,
title: $t('page.nested.menu321'),
},
},
],
},
],
},
],
},
];
export default routes;

View File

@@ -0,0 +1,85 @@
import type { RouteRecordRaw } from 'vue-router';
import { BasicLayout, IFrameView } from '@/layouts';
import { $t } from '@vben/locales/helper';
const routes: RouteRecordRaw[] = [
{
component: BasicLayout,
meta: {
icon: 'ic:round-settings-input-composite',
title: $t('page.outside.page'),
},
name: 'Outside',
path: '/outside',
redirect: '/outside/iframe',
children: [
{
name: 'iframe',
path: 'iframe',
meta: {
icon: 'mdi:newspaper-variant-outline',
title: $t('page.outside.embedded'),
},
redirect: '/outside/iframe/vue-document',
children: [
{
name: 'VueDocument',
path: 'vue-document',
component: IFrameView,
meta: {
icon: 'logos:vue',
iframeSrc: 'https://cn.vuejs.org/',
keepAlive: true,
title: 'Vue',
},
},
{
name: 'Tailwindcss',
path: 'tailwindcss',
component: IFrameView,
meta: {
icon: 'devicon:tailwindcss',
iframeSrc: 'https://tailwindcss.com/',
// keepAlive: true,
title: 'Tailwindcss',
},
},
],
},
{
name: 'ExternalLink',
path: 'external-link',
meta: {
icon: 'mdi:newspaper-variant-multiple-outline',
title: $t('page.outside.external-link'),
},
redirect: '/outside/external-link/vite',
children: [
{
name: 'Vite',
path: 'vite',
component: IFrameView,
meta: {
icon: 'logos:vitejs',
link: 'https://vitejs.dev/',
title: 'Vite',
},
},
{
name: 'VueUse',
path: 'vue-use',
component: IFrameView,
meta: {
icon: 'logos:vueuse',
link: 'https://vueuse.org',
title: 'VueUse',
},
},
],
},
],
},
];
export default routes;

View File

@@ -0,0 +1,54 @@
import type { RouteRecordRaw } from 'vue-router';
import { VBEN_GITHUB_URL, VBEN_LOGO } from '@vben/constants';
import { BasicLayout, IFrameView } from '@/layouts';
import { $t } from '@vben/locales/helper';
const routes: RouteRecordRaw[] = [
{
component: BasicLayout,
meta: {
icon: VBEN_LOGO,
order: 9999,
title: 'Vben',
},
name: 'AboutLayout',
path: '/vben-admin',
redirect: '/vben-admin/about',
children: [
{
name: 'VbenAbout',
path: 'about',
component: () => import('@/views/_essential/vben/about/index.vue'),
meta: {
icon: 'mdi:creative-commons',
title: $t('page.vben.about'),
},
},
{
name: 'VbenDocument',
path: 'document',
component: IFrameView,
meta: {
icon: 'mdi:flame-circle',
iframeSrc: 'https://doc.vvbin.cn/',
keepAlive: true,
title: $t('page.vben.document'),
},
},
{
name: 'VbenGithub',
path: 'github',
component: IFrameView,
meta: {
icon: 'mdi:github',
link: VBEN_GITHUB_URL,
title: 'Github',
},
},
],
},
];
export default routes;