demos.ts 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. import type { RouteRecordRaw } from 'vue-router';
  2. import { BasicLayout, IFrameView } from '#/layouts';
  3. import { $t } from '#/locales';
  4. const routes: RouteRecordRaw[] = [
  5. {
  6. component: BasicLayout,
  7. meta: {
  8. icon: 'ic:baseline-view-in-ar',
  9. keepAlive: true,
  10. order: 1000,
  11. title: $t('page.demos.title'),
  12. },
  13. name: 'Demos',
  14. path: '/demos',
  15. redirect: '/demos/access',
  16. children: [
  17. {
  18. meta: {
  19. icon: 'mdi:shield-key-outline',
  20. title: $t('page.demos.access.frontendPermissions'),
  21. },
  22. name: 'Access',
  23. path: 'access',
  24. redirect: '/demos/access/page-control',
  25. children: [
  26. {
  27. name: 'AccessPageControl',
  28. path: 'page-control',
  29. component: () => import('#/views/demos/access/index.vue'),
  30. meta: {
  31. icon: 'mdi:page-previous-outline',
  32. title: $t('page.demos.access.pageAccess'),
  33. },
  34. },
  35. {
  36. name: 'AccessButtonControl',
  37. path: 'button-control',
  38. component: () => import('#/views/demos/access/button-control.vue'),
  39. meta: {
  40. icon: 'mdi:button-cursor',
  41. title: $t('page.demos.access.buttonControl'),
  42. },
  43. },
  44. {
  45. name: 'AccessMenuVisible403',
  46. path: 'menu-visible-403',
  47. component: () =>
  48. import('#/views/demos/access/menu-visible-403.vue'),
  49. meta: {
  50. authority: ['no-body'],
  51. icon: 'mdi:button-cursor',
  52. menuVisibleWithForbidden: true,
  53. title: $t('page.demos.access.menuVisible403'),
  54. },
  55. },
  56. {
  57. name: 'AccessSuperVisible',
  58. path: 'super-visible',
  59. component: () => import('#/views/demos/access/super-visible.vue'),
  60. meta: {
  61. authority: ['super'],
  62. icon: 'mdi:button-cursor',
  63. title: $t('page.demos.access.superVisible'),
  64. },
  65. },
  66. {
  67. name: 'AccessAdminVisible',
  68. path: 'admin-visible',
  69. component: () => import('#/views/demos/access/admin-visible.vue'),
  70. meta: {
  71. authority: ['admin'],
  72. icon: 'mdi:button-cursor',
  73. title: $t('page.demos.access.adminVisible'),
  74. },
  75. },
  76. {
  77. name: 'AccessUserVisible',
  78. path: 'user-visible',
  79. component: () => import('#/views/demos/access/user-visible.vue'),
  80. meta: {
  81. authority: ['user'],
  82. icon: 'mdi:button-cursor',
  83. title: $t('page.demos.access.userVisible'),
  84. },
  85. },
  86. ],
  87. },
  88. {
  89. meta: {
  90. icon: 'mdi:feature-highlight',
  91. title: $t('page.demos.features.title'),
  92. },
  93. name: 'Features',
  94. path: 'features',
  95. redirect: '/demos/features/hide-menu-children',
  96. children: [
  97. {
  98. name: 'HideChildrenInMenuParent',
  99. path: 'hide-children-in-menu',
  100. component: () =>
  101. import('#/views/demos/features/hide-menu-children/parent.vue'),
  102. meta: {
  103. hideChildrenInMenu: true,
  104. icon: 'ic:round-menu',
  105. title: 'page.demos.features.hideChildrenInMenu',
  106. },
  107. children: [
  108. {
  109. name: 'HideChildrenInMenuChildren',
  110. path: 'hide-children-in-menu',
  111. component: () =>
  112. import(
  113. '#/views/demos/features/hide-menu-children/children.vue'
  114. ),
  115. },
  116. ],
  117. },
  118. {
  119. name: 'LoginExpired',
  120. path: 'login-expired',
  121. component: () =>
  122. import('#/views/demos/features/login-expired/index.vue'),
  123. meta: {
  124. icon: 'mdi:encryption-expiration',
  125. title: $t('page.demos.features.loginExpired'),
  126. },
  127. },
  128. ],
  129. },
  130. {
  131. meta: {
  132. icon: 'mdi:lightbulb-error-outline',
  133. title: $t('page.demos.fallback.title'),
  134. },
  135. name: 'Fallback',
  136. path: 'fallback',
  137. redirect: '/demos/fallback/403',
  138. children: [
  139. {
  140. name: 'Fallback403',
  141. path: '403',
  142. component: () => import('#/views/_core/fallback/forbidden.vue'),
  143. meta: {
  144. icon: 'mdi:do-not-disturb-alt',
  145. title: '403',
  146. },
  147. },
  148. {
  149. name: 'Fallback404',
  150. path: '404',
  151. component: () => import('#/views/_core/fallback/not-found.vue'),
  152. meta: {
  153. icon: 'mdi:table-off',
  154. title: '404',
  155. },
  156. },
  157. {
  158. name: 'Fallback500',
  159. path: '500',
  160. component: () =>
  161. import('#/views/_core/fallback/internal-error.vue'),
  162. meta: {
  163. icon: 'mdi:server-network-off',
  164. title: '500',
  165. },
  166. },
  167. {
  168. name: 'FallbackOffline',
  169. path: 'offline',
  170. component: () => import('#/views/_core/fallback/offline.vue'),
  171. meta: {
  172. icon: 'mdi:offline',
  173. title: $t('fallback.offline'),
  174. },
  175. },
  176. ],
  177. },
  178. {
  179. meta: {
  180. icon: 'ic:round-settings-input-composite',
  181. title: $t('page.demos.outside.title'),
  182. },
  183. name: 'Outside',
  184. path: 'outside',
  185. redirect: '/demos/outside/iframe',
  186. children: [
  187. {
  188. name: 'iframe',
  189. path: 'iframe',
  190. meta: {
  191. icon: 'mdi:newspaper-variant-outline',
  192. title: $t('page.demos.outside.embedded'),
  193. },
  194. redirect: '/demos/outside/iframe/vue-document',
  195. children: [
  196. {
  197. name: 'VueDocument',
  198. path: 'vue-document',
  199. component: IFrameView,
  200. meta: {
  201. icon: 'logos:vue',
  202. iframeSrc: 'https://cn.vuejs.org/',
  203. keepAlive: true,
  204. title: 'Vue',
  205. },
  206. },
  207. {
  208. name: 'Tailwindcss',
  209. path: 'tailwindcss',
  210. component: IFrameView,
  211. meta: {
  212. icon: 'devicon:tailwindcss',
  213. iframeSrc: 'https://tailwindcss.com/',
  214. // keepAlive: true,
  215. title: 'Tailwindcss',
  216. },
  217. },
  218. ],
  219. },
  220. {
  221. name: 'ExternalLink',
  222. path: 'external-link',
  223. meta: {
  224. icon: 'mdi:newspaper-variant-multiple-outline',
  225. title: $t('page.demos.outside.externalLink'),
  226. },
  227. redirect: '/demos/outside/external-link/vite',
  228. children: [
  229. {
  230. name: 'Vite',
  231. path: 'vite',
  232. component: IFrameView,
  233. meta: {
  234. icon: 'logos:vitejs',
  235. link: 'https://vitejs.dev/',
  236. title: 'Vite',
  237. },
  238. },
  239. {
  240. name: 'VueUse',
  241. path: 'vue-use',
  242. component: IFrameView,
  243. meta: {
  244. icon: 'logos:vueuse',
  245. link: 'https://vueuse.org',
  246. title: 'VueUse',
  247. },
  248. },
  249. ],
  250. },
  251. ],
  252. },
  253. {
  254. meta: {
  255. icon: 'ic:round-menu',
  256. title: $t('page.demos.nested.title'),
  257. },
  258. name: 'Nested',
  259. path: 'nested',
  260. redirect: '/demos/nested/menu1',
  261. children: [
  262. {
  263. name: 'Menu1',
  264. path: 'menu1',
  265. component: () => import('#/views/demos/nested/menu-1.vue'),
  266. meta: {
  267. icon: 'ic:round-menu',
  268. keepAlive: true,
  269. title: $t('page.demos.nested.menu1'),
  270. },
  271. },
  272. {
  273. name: 'Menu2',
  274. path: 'menu2',
  275. meta: {
  276. icon: 'ic:round-menu',
  277. keepAlive: true,
  278. title: $t('page.demos.nested.menu2'),
  279. },
  280. redirect: '/demos/nested/menu2/menu2-1',
  281. children: [
  282. {
  283. name: 'Menu21',
  284. path: 'menu2-1',
  285. component: () => import('#/views/demos/nested/menu-2-1.vue'),
  286. meta: {
  287. icon: 'ic:round-menu',
  288. keepAlive: true,
  289. title: $t('page.demos.nested.menu2_1'),
  290. },
  291. },
  292. ],
  293. },
  294. {
  295. name: 'Menu3',
  296. path: 'menu3',
  297. meta: {
  298. icon: 'ic:round-menu',
  299. title: $t('page.demos.nested.menu3'),
  300. },
  301. redirect: '/demos/nested/menu3/menu3-1',
  302. children: [
  303. {
  304. name: 'Menu31',
  305. path: 'menu3-1',
  306. component: () => import('#/views/demos/nested/menu-3-1.vue'),
  307. meta: {
  308. icon: 'ic:round-menu',
  309. keepAlive: true,
  310. title: $t('page.demos.nested.menu3_1'),
  311. },
  312. },
  313. {
  314. name: 'Menu32',
  315. path: 'menu3-2',
  316. meta: {
  317. icon: 'ic:round-menu',
  318. title: $t('page.demos.nested.menu3_2'),
  319. },
  320. redirect: '/demos/nested/menu3/menu3-2/menu3-2-1',
  321. children: [
  322. {
  323. name: 'Menu321',
  324. path: 'menu3-2-1',
  325. component: () =>
  326. import('#/views/demos/nested/menu-3-2-1.vue'),
  327. meta: {
  328. icon: 'ic:round-menu',
  329. keepAlive: true,
  330. title: $t('page.demos.nested.menu3_2_1'),
  331. },
  332. },
  333. ],
  334. },
  335. ],
  336. },
  337. ],
  338. },
  339. ],
  340. },
  341. ];
  342. export default routes;