|
| 1 | +import type { RouteRecordRaw } from 'vue-router'; |
| 2 | + |
| 3 | +import { $t } from '@vben/locales/helper'; |
| 4 | + |
| 5 | +import { BasicLayout, IFrameView } from '#/layouts'; |
| 6 | + |
| 7 | +const routes: RouteRecordRaw[] = [ |
| 8 | + { |
| 9 | + component: BasicLayout, |
| 10 | + meta: { |
| 11 | + icon: 'ic:baseline-view-in-ar', |
| 12 | + keepAlive: true, |
| 13 | + order: 1000, |
| 14 | + title: $t('page.demos.title'), |
| 15 | + }, |
| 16 | + name: 'Demos', |
| 17 | + path: '/demos', |
| 18 | + redirect: '/demos/fallback/403', |
| 19 | + children: [ |
| 20 | + { |
| 21 | + meta: { |
| 22 | + icon: 'mdi:lightbulb-error-outline', |
| 23 | + title: $t('page.demos.fallback.title'), |
| 24 | + }, |
| 25 | + name: 'FallbackLayout', |
| 26 | + path: '/fallback', |
| 27 | + redirect: '/fallback/403', |
| 28 | + children: [ |
| 29 | + { |
| 30 | + name: 'Fallback403', |
| 31 | + path: '403', |
| 32 | + component: () => |
| 33 | + import('#/views/_essential/fallback/forbidden.vue'), |
| 34 | + meta: { |
| 35 | + icon: 'mdi:do-not-disturb-alt', |
| 36 | + title: '403', |
| 37 | + }, |
| 38 | + }, |
| 39 | + { |
| 40 | + name: 'Fallback404', |
| 41 | + path: '404', |
| 42 | + component: () => |
| 43 | + import('#/views/_essential/fallback/not-found.vue'), |
| 44 | + meta: { |
| 45 | + icon: 'mdi:table-off', |
| 46 | + title: '404', |
| 47 | + }, |
| 48 | + }, |
| 49 | + { |
| 50 | + name: 'Fallback500', |
| 51 | + path: '500', |
| 52 | + component: () => |
| 53 | + import('#/views/_essential/fallback/internal-error.vue'), |
| 54 | + meta: { |
| 55 | + icon: 'mdi:server-network-off', |
| 56 | + title: '500', |
| 57 | + }, |
| 58 | + }, |
| 59 | + { |
| 60 | + name: 'FallbackOffline', |
| 61 | + path: 'offline', |
| 62 | + component: () => import('#/views/_essential/fallback/offline.vue'), |
| 63 | + meta: { |
| 64 | + icon: 'mdi:offline', |
| 65 | + title: $t('fallback.offline'), |
| 66 | + }, |
| 67 | + }, |
| 68 | + ], |
| 69 | + }, |
| 70 | + { |
| 71 | + meta: { |
| 72 | + icon: 'ic:round-settings-input-composite', |
| 73 | + title: $t('page.demos.outside.title'), |
| 74 | + }, |
| 75 | + name: 'Outside', |
| 76 | + path: '/outside', |
| 77 | + redirect: '/outside/iframe', |
| 78 | + children: [ |
| 79 | + { |
| 80 | + name: 'iframe', |
| 81 | + path: 'iframe', |
| 82 | + meta: { |
| 83 | + icon: 'mdi:newspaper-variant-outline', |
| 84 | + title: $t('page.demos.outside.embedded'), |
| 85 | + }, |
| 86 | + redirect: '/outside/iframe/vue-document', |
| 87 | + children: [ |
| 88 | + { |
| 89 | + name: 'VueDocument', |
| 90 | + path: 'vue-document', |
| 91 | + component: IFrameView, |
| 92 | + meta: { |
| 93 | + icon: 'logos:vue', |
| 94 | + iframeSrc: 'https://cn.vuejs.org/', |
| 95 | + keepAlive: true, |
| 96 | + title: 'Vue', |
| 97 | + }, |
| 98 | + }, |
| 99 | + { |
| 100 | + name: 'Tailwindcss', |
| 101 | + path: 'tailwindcss', |
| 102 | + component: IFrameView, |
| 103 | + meta: { |
| 104 | + icon: 'devicon:tailwindcss', |
| 105 | + iframeSrc: 'https://tailwindcss.com/', |
| 106 | + // keepAlive: true, |
| 107 | + title: 'Tailwindcss', |
| 108 | + }, |
| 109 | + }, |
| 110 | + ], |
| 111 | + }, |
| 112 | + { |
| 113 | + name: 'ExternalLink', |
| 114 | + path: 'external-link', |
| 115 | + meta: { |
| 116 | + icon: 'mdi:newspaper-variant-multiple-outline', |
| 117 | + title: $t('page.demos.outside.external-link'), |
| 118 | + }, |
| 119 | + redirect: '/outside/external-link/vite', |
| 120 | + children: [ |
| 121 | + { |
| 122 | + name: 'Vite', |
| 123 | + path: 'vite', |
| 124 | + component: IFrameView, |
| 125 | + meta: { |
| 126 | + icon: 'logos:vitejs', |
| 127 | + link: 'https://vitejs.dev/', |
| 128 | + title: 'Vite', |
| 129 | + }, |
| 130 | + }, |
| 131 | + { |
| 132 | + name: 'VueUse', |
| 133 | + path: 'vue-use', |
| 134 | + component: IFrameView, |
| 135 | + meta: { |
| 136 | + icon: 'logos:vueuse', |
| 137 | + link: 'https://vueuse.org', |
| 138 | + title: 'VueUse', |
| 139 | + }, |
| 140 | + }, |
| 141 | + ], |
| 142 | + }, |
| 143 | + ], |
| 144 | + }, |
| 145 | + { |
| 146 | + meta: { |
| 147 | + icon: 'ic:round-menu', |
| 148 | + title: $t('page.demos.nested.title'), |
| 149 | + }, |
| 150 | + name: 'Nested', |
| 151 | + path: 'nested', |
| 152 | + redirect: '/demos/nested/menu1', |
| 153 | + children: [ |
| 154 | + { |
| 155 | + name: 'Menu1', |
| 156 | + path: 'menu1', |
| 157 | + component: () => import('#/views/demos/nested/menu-1.vue'), |
| 158 | + meta: { |
| 159 | + icon: 'ic:round-menu', |
| 160 | + keepAlive: true, |
| 161 | + title: $t('page.demos.nested.menu1'), |
| 162 | + }, |
| 163 | + }, |
| 164 | + { |
| 165 | + name: 'Menu2', |
| 166 | + path: 'menu2', |
| 167 | + meta: { |
| 168 | + icon: 'ic:round-menu', |
| 169 | + keepAlive: true, |
| 170 | + title: $t('page.demos.nested.menu2'), |
| 171 | + }, |
| 172 | + redirect: '/nested/menu2/menu2-1', |
| 173 | + children: [ |
| 174 | + { |
| 175 | + name: 'Menu21', |
| 176 | + path: 'menu2-1', |
| 177 | + component: () => import('#/views/demos/nested/menu-2-1.vue'), |
| 178 | + meta: { |
| 179 | + icon: 'ic:round-menu', |
| 180 | + keepAlive: true, |
| 181 | + title: $t('page.demos.nested.menu21'), |
| 182 | + }, |
| 183 | + }, |
| 184 | + ], |
| 185 | + }, |
| 186 | + { |
| 187 | + name: 'Menu3', |
| 188 | + path: 'menu3', |
| 189 | + meta: { |
| 190 | + icon: 'ic:round-menu', |
| 191 | + title: $t('page.demos.nested.menu3'), |
| 192 | + }, |
| 193 | + redirect: '/nested/menu3/menu3-1', |
| 194 | + children: [ |
| 195 | + { |
| 196 | + name: 'Menu31', |
| 197 | + path: 'menu3-1', |
| 198 | + component: () => import('#/views/demos/nested/menu-3-1.vue'), |
| 199 | + meta: { |
| 200 | + icon: 'ic:round-menu', |
| 201 | + keepAlive: true, |
| 202 | + title: $t('page.demos.nested.menu31'), |
| 203 | + }, |
| 204 | + }, |
| 205 | + { |
| 206 | + name: 'Menu32', |
| 207 | + path: 'menu3-2', |
| 208 | + meta: { |
| 209 | + icon: 'ic:round-menu', |
| 210 | + title: $t('page.demos.nested.menu32'), |
| 211 | + }, |
| 212 | + redirect: '/nested/menu3/menu3-2/menu3-2-1', |
| 213 | + children: [ |
| 214 | + { |
| 215 | + name: 'Menu321', |
| 216 | + path: 'menu3-2-1', |
| 217 | + component: () => |
| 218 | + import('#/views/demos/nested/menu-3-2-1.vue'), |
| 219 | + meta: { |
| 220 | + icon: 'ic:round-menu', |
| 221 | + keepAlive: true, |
| 222 | + title: $t('page.demos.nested.menu321'), |
| 223 | + }, |
| 224 | + }, |
| 225 | + ], |
| 226 | + }, |
| 227 | + ], |
| 228 | + }, |
| 229 | + ], |
| 230 | + }, |
| 231 | + ], |
| 232 | + }, |
| 233 | +]; |
| 234 | + |
| 235 | +export default routes; |
0 commit comments