fix(projects): 修复在新版vite下环境变量获取不到的问题
This commit is contained in:
parent
2d6d179d66
commit
3fb13ca9e7
2
components.d.ts
vendored
2
components.d.ts
vendored
@ -14,7 +14,6 @@ declare module 'vue' {
|
|||||||
IconAntDesignEnterOutlined: typeof import('~icons/ant-design/enter-outlined')['default']
|
IconAntDesignEnterOutlined: typeof import('~icons/ant-design/enter-outlined')['default']
|
||||||
IconAntDesignSettingOutlined: typeof import('~icons/ant-design/setting-outlined')['default']
|
IconAntDesignSettingOutlined: typeof import('~icons/ant-design/setting-outlined')['default']
|
||||||
IconCustomAvatar: typeof import('~icons/custom/avatar')['default']
|
IconCustomAvatar: typeof import('~icons/custom/avatar')['default']
|
||||||
IconCustomBanner: typeof import('~icons/custom/banner')['default']
|
|
||||||
IconCustomLogo: typeof import('~icons/custom/logo')['default']
|
IconCustomLogo: typeof import('~icons/custom/logo')['default']
|
||||||
IconCustomLogoFill: typeof import('~icons/custom/logo-fill')['default']
|
IconCustomLogoFill: typeof import('~icons/custom/logo-fill')['default']
|
||||||
IconGridiconsFullscreen: typeof import('~icons/gridicons/fullscreen')['default']
|
IconGridiconsFullscreen: typeof import('~icons/gridicons/fullscreen')['default']
|
||||||
@ -30,7 +29,6 @@ declare module 'vue' {
|
|||||||
IconMdiPin: typeof import('~icons/mdi/pin')['default']
|
IconMdiPin: typeof import('~icons/mdi/pin')['default']
|
||||||
IconMdiPinOff: typeof import('~icons/mdi/pin-off')['default']
|
IconMdiPinOff: typeof import('~icons/mdi/pin-off')['default']
|
||||||
IconMdiRefresh: typeof import('~icons/mdi/refresh')['default']
|
IconMdiRefresh: typeof import('~icons/mdi/refresh')['default']
|
||||||
IconMdiWechat: typeof import('~icons/mdi/wechat')['default']
|
|
||||||
IconMdiWhiteBalanceSunny: typeof import('~icons/mdi/white-balance-sunny')['default']
|
IconMdiWhiteBalanceSunny: typeof import('~icons/mdi/white-balance-sunny')['default']
|
||||||
IconPhCaretDoubleLeftBold: typeof import('~icons/ph/caret-double-left-bold')['default']
|
IconPhCaretDoubleLeftBold: typeof import('~icons/ph/caret-double-left-bold')['default']
|
||||||
IconPhCaretDoubleRightBold: typeof import('~icons/ph/caret-double-right-bold')['default']
|
IconPhCaretDoubleRightBold: typeof import('~icons/ph/caret-double-right-bold')['default']
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antv/g2plot": "^2.4.15",
|
"@antv/g2plot": "^2.4.15",
|
||||||
"@better-scroll/core": "^2.4.2",
|
"@better-scroll/core": "^2.4.2",
|
||||||
"@vueuse/core": "^8.2.3",
|
"@vueuse/core": "^8.2.4",
|
||||||
"axios": "^0.26.1",
|
"axios": "^0.26.1",
|
||||||
"clipboard": "^2.0.10",
|
"clipboard": "^2.0.10",
|
||||||
"colord": "^2.9.2",
|
"colord": "^2.9.2",
|
||||||
@ -47,14 +47,14 @@
|
|||||||
"vditor": "^3.8.13",
|
"vditor": "^3.8.13",
|
||||||
"vue": "^3.2.31",
|
"vue": "^3.2.31",
|
||||||
"vue-router": "^4.0.14",
|
"vue-router": "^4.0.14",
|
||||||
"wangeditor": "^4.7.12",
|
"wangeditor": "^4.7.13",
|
||||||
"xgplayer": "^2.31.6"
|
"xgplayer": "^2.31.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@amap/amap-jsapi-types": "^0.0.8",
|
"@amap/amap-jsapi-types": "^0.0.8",
|
||||||
"@commitlint/cli": "^16.2.3",
|
"@commitlint/cli": "^16.2.3",
|
||||||
"@commitlint/config-conventional": "^16.2.1",
|
"@commitlint/config-conventional": "^16.2.1",
|
||||||
"@iconify/json": "^2.1.23",
|
"@iconify/json": "^2.1.24",
|
||||||
"@iconify/vue": "^3.2.1",
|
"@iconify/vue": "^3.2.1",
|
||||||
"@types/bmapgl": "^0.0.5",
|
"@types/bmapgl": "^0.0.5",
|
||||||
"@types/crypto-js": "^4.1.1",
|
"@types/crypto-js": "^4.1.1",
|
||||||
@ -88,7 +88,7 @@
|
|||||||
"typescript": "^4.6.3",
|
"typescript": "^4.6.3",
|
||||||
"unplugin-icons": "^0.14.1",
|
"unplugin-icons": "^0.14.1",
|
||||||
"unplugin-vue-components": "^0.18.5",
|
"unplugin-vue-components": "^0.18.5",
|
||||||
"vite": "2.9.1",
|
"vite": "^2.9.1",
|
||||||
"vite-plugin-html": "^3.2.0",
|
"vite-plugin-html": "^3.2.0",
|
||||||
"vite-plugin-html-template": "^1.1.2",
|
"vite-plugin-html-template": "^1.1.2",
|
||||||
"vite-plugin-mock": "^2.9.6",
|
"vite-plugin-mock": "^2.9.6",
|
||||||
|
5411
pnpm-lock.yaml
5411
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
@ -18,22 +18,22 @@ export function useBasicLayout() {
|
|||||||
vertical: {
|
vertical: {
|
||||||
showLogo: false,
|
showLogo: false,
|
||||||
showHeaderMenu: false,
|
showHeaderMenu: false,
|
||||||
showMenuCollape: true
|
showMenuCollapse: true
|
||||||
},
|
},
|
||||||
'vertical-mix': {
|
'vertical-mix': {
|
||||||
showLogo: false,
|
showLogo: false,
|
||||||
showHeaderMenu: false,
|
showHeaderMenu: false,
|
||||||
showMenuCollape: false
|
showMenuCollapse: false
|
||||||
},
|
},
|
||||||
horizontal: {
|
horizontal: {
|
||||||
showLogo: true,
|
showLogo: true,
|
||||||
showHeaderMenu: true,
|
showHeaderMenu: true,
|
||||||
showMenuCollape: false
|
showMenuCollapse: false
|
||||||
},
|
},
|
||||||
'horizontal-mix': {
|
'horizontal-mix': {
|
||||||
showLogo: true,
|
showLogo: true,
|
||||||
showHeaderMenu: false,
|
showHeaderMenu: false,
|
||||||
showMenuCollape: true
|
showMenuCollapse: true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -13,13 +13,9 @@ export default function useReload() {
|
|||||||
async function handleReload(duration = 0) {
|
async function handleReload(duration = 0) {
|
||||||
setFalse();
|
setFalse();
|
||||||
await nextTick();
|
await nextTick();
|
||||||
if (duration) {
|
setTimeout(() => {
|
||||||
setTimeout(() => {
|
|
||||||
setTrue();
|
|
||||||
}, duration);
|
|
||||||
} else {
|
|
||||||
setTrue();
|
setTrue();
|
||||||
}
|
}, duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<dark-mode-container class="global-header flex-y-center h-full">
|
<dark-mode-container class="global-header flex-y-center h-full">
|
||||||
<global-logo v-if="showLogo" :show-title="true" class="h-full" :style="{ width: theme.sider.width + 'px' }" />
|
<global-logo v-if="showLogo" :show-title="true" class="h-full" :style="{ width: theme.sider.width + 'px' }" />
|
||||||
<div v-if="!showHeaderMenu" class="flex-1-hidden flex-y-center h-full">
|
<div v-if="!showHeaderMenu" class="flex-1-hidden flex-y-center h-full">
|
||||||
<menu-collapse v-if="showMenuCollape" />
|
<menu-collapse v-if="showMenuCollapse" />
|
||||||
<global-breadcrumb v-if="theme.header.crumb.visible" />
|
<global-breadcrumb v-if="theme.header.crumb.visible" />
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="flex-1-hidden flex-y-center h-full" :style="{ justifyContent: theme.menu.horizontalPosition }">
|
<div v-else class="flex-1-hidden flex-y-center h-full" :style="{ justifyContent: theme.menu.horizontalPosition }">
|
||||||
@ -38,7 +38,7 @@ interface Props {
|
|||||||
/** 显示头部菜单 */
|
/** 显示头部菜单 */
|
||||||
showHeaderMenu: GlobalHeaderProps['showHeaderMenu'];
|
showHeaderMenu: GlobalHeaderProps['showHeaderMenu'];
|
||||||
/** 显示菜单折叠按钮 */
|
/** 显示菜单折叠按钮 */
|
||||||
showMenuCollape: GlobalHeaderProps['showMenuCollape'];
|
showMenuCollapse: GlobalHeaderProps['showMenuCollapse'];
|
||||||
}
|
}
|
||||||
|
|
||||||
defineProps<Props>();
|
defineProps<Props>();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<vertical-sider v-if="!isVerticalMix" class="global-sider" />
|
<vertical-mix-sider v-if="isVerticalMix" class="global-sider" />
|
||||||
<vertical-mix-sider v-else class="global-sider" />
|
<vertical-sider v-else class="global-sider" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
2
src/typings/system.d.ts
vendored
2
src/typings/system.d.ts
vendored
@ -238,7 +238,7 @@ interface GlobalHeaderProps {
|
|||||||
/** 显示头部菜单 */
|
/** 显示头部菜单 */
|
||||||
showHeaderMenu: boolean;
|
showHeaderMenu: boolean;
|
||||||
/** 显示菜单折叠按钮 */
|
/** 显示菜单折叠按钮 */
|
||||||
showMenuCollape: boolean;
|
showMenuCollapse: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 菜单项配置 */
|
/** 菜单项配置 */
|
||||||
|
@ -2,7 +2,7 @@ import { defineConfig, loadEnv } from 'vite';
|
|||||||
import { resolvePath, viteDefine, setupVitePlugins, createViteProxy } from './build';
|
import { resolvePath, viteDefine, setupVitePlugins, createViteProxy } from './build';
|
||||||
|
|
||||||
export default defineConfig(configEnv => {
|
export default defineConfig(configEnv => {
|
||||||
const viteEnv = loadEnv(configEnv.mode, `.env.${configEnv.mode}`) as ImportMetaEnv;
|
const viteEnv = loadEnv(configEnv.mode, process.cwd()) as ImportMetaEnv;
|
||||||
const vitePath = resolvePath('./', import.meta.url);
|
const vitePath = resolvePath('./', import.meta.url);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user