mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-23 06:36:19 +08:00
perf: Use Imports Instead of Aliases
This commit is contained in:
@@ -21,6 +21,9 @@
|
||||
"preview": "vite preview",
|
||||
"typecheck": "vue-tsc --noEmit --skipLibCheck"
|
||||
},
|
||||
"imports": {
|
||||
"#/*": "./src/*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vben-core/helpers": "workspace:*",
|
||||
"@vben-core/preferences": "workspace:*",
|
||||
|
@@ -2,7 +2,7 @@ import type { UserInfo } from '@vben/types';
|
||||
|
||||
import type { UserApiType } from '../types';
|
||||
|
||||
import { request } from '@/forward';
|
||||
import { request } from '#/forward';
|
||||
|
||||
/**
|
||||
* 登录
|
||||
|
@@ -4,7 +4,7 @@ import { setupI18n } from '@vben/locales';
|
||||
import '@vben/styles';
|
||||
import { preferences } from '@vben-core/preferences';
|
||||
|
||||
import { setupStore } from '@/store';
|
||||
import { setupStore } from '#/store';
|
||||
|
||||
import App from './app.vue';
|
||||
import { router } from './router';
|
||||
|
@@ -9,9 +9,9 @@ import { useAccessStore } from '@vben-core/stores';
|
||||
|
||||
import { useTitle } from '@vueuse/core';
|
||||
|
||||
import { dynamicRoutes, essentialsRouteNames } from '@/router/routes';
|
||||
import { dynamicRoutes, essentialsRouteNames } from '#/router/routes';
|
||||
|
||||
const forbiddenPage = () => import('@/views/_essential/fallback/forbidden.vue');
|
||||
const forbiddenPage = () => import('#/views/_essential/fallback/forbidden.vue');
|
||||
|
||||
/**
|
||||
* 通用守卫配置
|
||||
|
@@ -3,13 +3,12 @@ import type { RouteRecordRaw } from 'vue-router';
|
||||
import { DEFAULT_HOME_PATH } from '@vben/constants';
|
||||
import { $t } from '@vben/locales';
|
||||
|
||||
import { AuthPageLayoutType } from '@/layouts';
|
||||
|
||||
import Login from '@/views/_essential/authentication/login.vue';
|
||||
import { AuthPageLayoutType } from '#/layouts';
|
||||
import Login from '#/views/_essential/authentication/login.vue';
|
||||
|
||||
/** 全局404页面 */
|
||||
const fallbackNotFoundRoute: RouteRecordRaw = {
|
||||
component: () => import('@/views/_essential/fallback/not-found.vue'),
|
||||
component: () => import('#/views/_essential/fallback/not-found.vue'),
|
||||
meta: {
|
||||
hideInBreadcrumb: true,
|
||||
hideInMenu: true,
|
||||
@@ -50,7 +49,7 @@ const essentialsRoutes: RouteRecordRaw[] = [
|
||||
name: 'CodeLogin',
|
||||
path: 'code-login',
|
||||
component: () =>
|
||||
import('@/views/_essential/authentication/code-login.vue'),
|
||||
import('#/views/_essential/authentication/code-login.vue'),
|
||||
meta: {
|
||||
title: $t('page.essentials.code-login'),
|
||||
},
|
||||
@@ -59,7 +58,7 @@ const essentialsRoutes: RouteRecordRaw[] = [
|
||||
name: 'QrCodeLogin',
|
||||
path: 'qrcode-login',
|
||||
component: () =>
|
||||
import('@/views/_essential/authentication/qrcode-login.vue'),
|
||||
import('#/views/_essential/authentication/qrcode-login.vue'),
|
||||
meta: {
|
||||
title: $t('page.essentials.qrcode-login'),
|
||||
},
|
||||
@@ -68,7 +67,7 @@ const essentialsRoutes: RouteRecordRaw[] = [
|
||||
name: 'ForgetPassword',
|
||||
path: 'forget-password',
|
||||
component: () =>
|
||||
import('@/views/_essential/authentication/forget-password.vue'),
|
||||
import('#/views/_essential/authentication/forget-password.vue'),
|
||||
meta: {
|
||||
title: $t('page.essentials.forget-password'),
|
||||
},
|
||||
@@ -77,7 +76,7 @@ const essentialsRoutes: RouteRecordRaw[] = [
|
||||
name: 'Register',
|
||||
path: 'register',
|
||||
component: () =>
|
||||
import('@/views/_essential/authentication/register.vue'),
|
||||
import('#/views/_essential/authentication/register.vue'),
|
||||
meta: {
|
||||
title: $t('page.essentials.register'),
|
||||
},
|
||||
|
@@ -1,8 +1,9 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { BasicLayout } from '@/layouts';
|
||||
import { $t } from '@vben/locales/helper';
|
||||
|
||||
import { BasicLayout } from '#/layouts';
|
||||
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
component: BasicLayout,
|
||||
@@ -17,7 +18,7 @@ const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
name: 'Fallback403',
|
||||
path: '403',
|
||||
component: () => import('@/views/_essential/fallback/forbidden.vue'),
|
||||
component: () => import('#/views/_essential/fallback/forbidden.vue'),
|
||||
meta: {
|
||||
icon: 'mdi:do-not-disturb-alt',
|
||||
title: '403',
|
||||
@@ -26,7 +27,7 @@ const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
name: 'Fallback404',
|
||||
path: '404',
|
||||
component: () => import('@/views/_essential/fallback/not-found.vue'),
|
||||
component: () => import('#/views/_essential/fallback/not-found.vue'),
|
||||
meta: {
|
||||
icon: 'mdi:table-off',
|
||||
title: '404',
|
||||
@@ -36,7 +37,7 @@ const routes: RouteRecordRaw[] = [
|
||||
name: 'Fallback500',
|
||||
path: '500',
|
||||
component: () =>
|
||||
import('@/views/_essential/fallback/internal-error.vue'),
|
||||
import('#/views/_essential/fallback/internal-error.vue'),
|
||||
meta: {
|
||||
icon: 'mdi:server-network-off',
|
||||
title: '500',
|
||||
@@ -45,7 +46,7 @@ const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
name: 'FallbackOffline',
|
||||
path: 'offline',
|
||||
component: () => import('@/views/_essential/fallback/offline.vue'),
|
||||
component: () => import('#/views/_essential/fallback/offline.vue'),
|
||||
meta: {
|
||||
icon: 'mdi:offline',
|
||||
title: $t('fallback.offline'),
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { BasicLayout } from '@/layouts';
|
||||
import { BasicLayout } from '#/layouts';
|
||||
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
@@ -17,7 +17,7 @@ const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
name: 'Welcome',
|
||||
path: '/welcome',
|
||||
component: () => import('@/views/dashboard/index.vue'),
|
||||
component: () => import('#/views/dashboard/index.vue'),
|
||||
meta: {
|
||||
affixTab: true,
|
||||
title: 'Welcome',
|
||||
|
@@ -1,8 +1,9 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { BasicLayout } from '@/layouts';
|
||||
import { $t } from '@vben/locales/helper';
|
||||
|
||||
import { BasicLayout } from '#/layouts';
|
||||
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
component: BasicLayout,
|
||||
@@ -19,7 +20,7 @@ const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
name: 'Menu1',
|
||||
path: 'menu1',
|
||||
component: () => import('@/views/nested/menu-1.vue'),
|
||||
component: () => import('#/views/nested/menu-1.vue'),
|
||||
meta: {
|
||||
icon: 'ic:round-menu',
|
||||
keepAlive: true,
|
||||
@@ -39,7 +40,7 @@ const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
name: 'Menu21',
|
||||
path: 'menu2-1',
|
||||
component: () => import('@/views/nested/menu-2-1.vue'),
|
||||
component: () => import('#/views/nested/menu-2-1.vue'),
|
||||
meta: {
|
||||
icon: 'ic:round-menu',
|
||||
keepAlive: true,
|
||||
@@ -60,7 +61,7 @@ const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
name: 'Menu31',
|
||||
path: 'menu3-1',
|
||||
component: () => import('@/views/nested/menu-3-1.vue'),
|
||||
component: () => import('#/views/nested/menu-3-1.vue'),
|
||||
meta: {
|
||||
icon: 'ic:round-menu',
|
||||
keepAlive: true,
|
||||
@@ -79,7 +80,7 @@ const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
name: 'Menu321',
|
||||
path: 'menu3-2-1',
|
||||
component: () => import('@/views/nested/menu-3-2-1.vue'),
|
||||
component: () => import('#/views/nested/menu-3-2-1.vue'),
|
||||
meta: {
|
||||
icon: 'ic:round-menu',
|
||||
keepAlive: true,
|
||||
|
@@ -1,8 +1,9 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { BasicLayout, IFrameView } from '@/layouts';
|
||||
import { $t } from '@vben/locales/helper';
|
||||
|
||||
import { BasicLayout, IFrameView } from '#/layouts';
|
||||
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
component: BasicLayout,
|
||||
|
@@ -2,9 +2,10 @@ 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';
|
||||
|
||||
import { BasicLayout, IFrameView } from '#/layouts';
|
||||
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
component: BasicLayout,
|
||||
@@ -20,7 +21,7 @@ const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
name: 'VbenAbout',
|
||||
path: 'about',
|
||||
component: () => import('@/views/_essential/vben/about/index.vue'),
|
||||
component: () => import('#/views/_essential/vben/about/index.vue'),
|
||||
meta: {
|
||||
icon: 'mdi:creative-commons',
|
||||
title: $t('page.vben.about'),
|
||||
|
@@ -9,9 +9,10 @@ import { AuthenticationLogin } from '@vben/universal-ui';
|
||||
import { useRequest } from '@vben-core/request';
|
||||
import { useAccessStore } from '@vben-core/stores';
|
||||
|
||||
import { getUserInfo, userLogin } from '@/apis';
|
||||
import { notification } from 'ant-design-vue';
|
||||
|
||||
import { getUserInfo, userLogin } from '#/apis';
|
||||
|
||||
defineOptions({ name: 'Login' });
|
||||
|
||||
const router = useRouter();
|
||||
|
@@ -4,7 +4,7 @@
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
"#/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"references": [{ "path": "./tsconfig.node.json" }],
|
||||
|
Reference in New Issue
Block a user