style(projects): format code

This commit is contained in:
Soybean
2023-12-14 21:45:29 +08:00
parent a176dc443e
commit a748166399
127 changed files with 2472 additions and 3006 deletions

View File

@ -4,8 +4,9 @@ import { createDocumentTitleGuard } from './title';
import { createPermissionGuard } from './permission';
/**
* router guard
* @param router - router instance
* Router guard
*
* @param router - Router instance
*/
export function createRouterGuard(router: Router) {
createProgressGuard(router);

View File

@ -1,4 +1,4 @@
import type { Router, NavigationGuardNext, RouteLocationNormalized } from 'vue-router';
import type { NavigationGuardNext, RouteLocationNormalized, Router } from 'vue-router';
import type { RouteKey, RoutePath } from '@elegant-router/types';
import { useAuthStore } from '@/store/modules/auth';
import { useRouteStore } from '@/store/modules/route';

View File

@ -1,6 +1,6 @@
import { $t } from '@/locales';
import { useTitle } from '@vueuse/core';
import type { Router } from 'vue-router';
import { $t } from '@/locales';
export function createDocumentTitleGuard(router: Router) {
router.afterEach(to => {

View File

@ -1,10 +1,10 @@
import type { App } from 'vue';
import {
createRouter,
createWebHistory,
createWebHashHistory,
type RouterHistory,
createMemoryHistory,
type RouterHistory
createRouter,
createWebHashHistory,
createWebHistory
} from 'vue-router';
import { createRoutes } from './routes';
import { createRouterGuard } from './guard';
@ -24,9 +24,7 @@ export const router = createRouter({
routes: constantVueRoutes
});
/**
* setup Vue Router
*/
/** Setup Vue Router */
export async function setupRouter(app: App) {
app.use(router);
createRouterGuard(router);

View File

@ -1,4 +1,4 @@
import type { ElegantConstRoute, ElegantRoute, CustomRoute } from '@elegant-router/types';
import type { CustomRoute, ElegantConstRoute, ElegantRoute } from '@elegant-router/types';
import { generatedRoutes } from '../elegant/routes';
import { layouts, views } from '../elegant/imports';
import { transformElegantRoutesToVueRoutes } from '../elegant/transform';
@ -26,9 +26,7 @@ const customRoutes: CustomRoute[] = [
}
];
/**
* create routes
*/
/** Create routes */
export function createRoutes() {
const constantRoutes: ElegantRoute[] = [];
@ -51,8 +49,9 @@ export function createRoutes() {
}
/**
* get auth vue routes
* @param routes elegant routes
* Get auth vue routes
*
* @param routes Elegant routes
*/
export function getAuthVueRoutes(routes: ElegantConstRoute[]) {
return transformElegantRoutesToVueRoutes(routes, layouts, views);