From 49c5eaf1bc0ec2c16a74a8969a57879af83e9257 Mon Sep 17 00:00:00 2001
From: lyt <1105290566@qq.com>
Date: Fri, 25 Feb 2022 23:19:12 +0800
Subject: [PATCH] =?UTF-8?q?'admin-22.02.25:=E6=9B=B4=E6=96=B0=E7=89=88?=
=?UTF-8?q?=E6=9C=ACv2.0.1=EF=BC=8C=E6=9B=B4=E6=96=B0=E5=86=85=E5=AE=B9?=
=?UTF-8?q?=E6=9F=A5=E7=9C=8B=E6=A0=B9=E7=9B=AE=E5=BD=95CHANGELOG.md'?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
CHANGELOG.md | 10 ++++++++
package.json | 20 +++++++--------
src/components/svgIcon/index.vue | 2 +-
src/layout/navBars/tagsView/tagsView.vue | 4 +--
src/theme/element.scss | 1 -
src/utils/other.ts | 25 +++++++++++++++++++
src/utils/request.ts | 2 +-
src/utils/viteBuild.ts | 31 ------------------------
vite.config.ts | 17 ++++++-------
9 files changed, 57 insertions(+), 55 deletions(-)
delete mode 100644 src/utils/viteBuild.ts
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7592257..9705e47 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,16 @@
🎉🎉🔥 `vue-next-admin` 基于 vue3.x 、Typescript、vite、Element plus 等,适配手机、平板、pc 的后台开源免费模板库(vue2.x 请切换 vue-prev-admin 分支)
+## 2.0.1
+
+`2022.02.25`
+
+- 🌟 更新 依赖更新最新版本
+- 🎯 优化 svgIcon 图标组件
+- 🎯 优化 vite.config.ts 打包,感谢群友@YourObjec
+- 🐞 修复 tagViews 开启图标不显示问题(风格 5),感谢群友@坏人
+- 🐞 修复 [Element Plus 1.2.0-beta.6 以后的版本 el-table 在移动端无法左右滑动](https://gitee.com/lyt-top/vue-next-admin/issues/I4UPTP),感谢@YGDada
+
## 2.0.0
`2022.02.21`
diff --git a/package.json b/package.json
index 04bb5c8..c1ac21a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "vue-next-admin",
- "version": "2.0.0",
+ "version": "2.0.1",
"description": "vue3 vite next admin template",
"author": "lyt_20201208",
"license": "MIT",
@@ -17,7 +17,7 @@
"echarts": "^5.3.0",
"echarts-gl": "^2.0.8",
"echarts-wordcloud": "^2.0.0",
- "element-plus": "^2.0.2",
+ "element-plus": "^2.0.3",
"jsplumb": "^2.15.6",
"mitt": "^3.0.0",
"nprogress": "^0.2.0",
@@ -25,32 +25,32 @@
"qrcodejs2-fixes": "^0.0.2",
"screenfull": "^6.0.1",
"sortablejs": "^1.14.0",
- "splitpanes": "^3.0.6",
+ "splitpanes": "^3.1.1",
"vue": "^3.2.31",
"vue-clipboard3": "^1.0.1",
"vue-grid-layout": "^3.0.0-beta1",
"vue-i18n": "^9.1.9",
"vue-router": "^4.0.12",
"vuex": "^4.0.2",
- "wangeditor": "^4.7.11"
+ "wangeditor": "^4.7.12"
},
"devDependencies": {
- "@types/node": "^17.0.19",
+ "@types/node": "^17.0.21",
"@types/nprogress": "^0.2.0",
"@types/sortablejs": "^1.10.7",
- "@typescript-eslint/eslint-plugin": "^5.12.0",
- "@typescript-eslint/parser": "^5.12.0",
+ "@typescript-eslint/eslint-plugin": "^5.12.1",
+ "@typescript-eslint/parser": "^5.12.1",
"@vitejs/plugin-vue": "^2.2.2",
"@vue/compiler-sfc": "^3.2.31",
"dotenv": "^16.0.0",
"eslint": "^8.9.0",
- "eslint-plugin-vue": "^8.4.1",
+ "eslint-plugin-vue": "^8.5.0",
"prettier": "^2.5.1",
- "sass": "^1.49.8",
+ "sass": "^1.49.9",
"sass-loader": "^12.6.0",
"typescript": "^4.5.5",
"vite": "^2.8.4",
- "vue-eslint-parser": "^8.2.0"
+ "vue-eslint-parser": "^8.3.0"
},
"browserslist": [
"> 1%",
diff --git a/src/components/svgIcon/index.vue b/src/components/svgIcon/index.vue
index b370ee8..9b1aec9 100644
--- a/src/components/svgIcon/index.vue
+++ b/src/components/svgIcon/index.vue
@@ -28,7 +28,7 @@ export default {
},
setup(props: SvgIconProps) {
// 定义变量
- const linesString: string[] = ['https', 'http', '/src', '/assets'];
+ const linesString: any[] = ['https', 'http', '/src', '/assets', import.meta.env.VITE_PUBLIC_PATH];
const onLineStyle: string = `font-size: ${props.size}px;color: ${props.color}`;
const localsStyle: string = `width: ${props.size}px;height: ${props.size}px`;
diff --git a/src/layout/navBars/tagsView/tagsView.vue b/src/layout/navBars/tagsView/tagsView.vue
index 49770ad..68aff25 100644
--- a/src/layout/navBars/tagsView/tagsView.vue
+++ b/src/layout/navBars/tagsView/tagsView.vue
@@ -16,8 +16,8 @@
}
"
>
-
-
+
+
{{ $t(v.meta.title) }}
item === '').length;
+ if (leng !== d.length) {
+ arr.push(list[i]);
+ }
+ }
+ return arr;
+}
+
/**
* 统一批量导出
* @method elSvg 导出全局注册 element plus svg 图标
@@ -110,6 +131,7 @@ export function isMobile() {
* @method globalComponentSize element plus 全局组件大小
* @method deepClone 对象深克隆
* @method isMobile 判断是否是移动端
+ * @method handleEmpty 判断数组对象中所有属性是否为空,为空则删除当前行对象
*/
const other = {
elSvg: (app: App) => {
@@ -128,6 +150,9 @@ const other = {
isMobile: () => {
return isMobile();
},
+ handleEmpty: (list: any) => {
+ return handleEmpty(list);
+ },
};
// 统一批量导出
diff --git a/src/utils/request.ts b/src/utils/request.ts
index 1b2a70b..c1cb090 100644
--- a/src/utils/request.ts
+++ b/src/utils/request.ts
@@ -14,7 +14,7 @@ service.interceptors.request.use(
(config) => {
// 在发送请求之前做些什么 token
if (Session.get('token')) {
- config.headers.common['Authorization'] = `${Session.get('token')}`;
+ (config.headers).common['Authorization'] = `${Session.get('token')}`;
}
return config;
},
diff --git a/src/utils/viteBuild.ts b/src/utils/viteBuild.ts
deleted file mode 100644
index 4fa1191..0000000
--- a/src/utils/viteBuild.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import dotenv from 'dotenv';
-
-// 定义接口类型声明
-export interface ViteEnv {
- VITE_PORT: number;
- VITE_OPEN: boolean;
- VITE_PUBLIC_PATH: string;
-}
-
-/**
- * vite 打包相关
- * @link 参考:https://cn.vitejs.dev/guide/env-and-mode.html
- * @returns 返回 `VITE_xxx` 环境变量和模式信息
- */
-export function loadEnv(): ViteEnv {
- const env = process.env.NODE_ENV;
- const ret: any = {};
- const envList = [`.env.${env}.local`, `.env.${env}`, '.env.local', '.env'];
- envList.forEach((e) => {
- dotenv.config({ path: e });
- });
- for (const envName of Object.keys(process.env)) {
- let realName = (process.env as any)[envName].replace(/\\n/g, '\n');
- realName = realName === 'true' ? true : realName === 'false' ? false : realName;
- if (envName === 'VITE_PORT') realName = Number(realName);
- if (envName === 'VITE_OPEN') realName = Boolean(realName);
- ret[envName] = realName;
- process.env[envName] = realName;
- }
- return ret;
-}
diff --git a/vite.config.ts b/vite.config.ts
index 846bebc..4640e1e 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,33 +1,30 @@
import vue from '@vitejs/plugin-vue';
import { resolve } from 'path';
-import type { UserConfig, ConfigEnv } from 'vite';
-import { defineConfig } from 'vite';
-import { loadEnv } from './src/utils/viteBuild';
+import { defineConfig, loadEnv, ConfigEnv } from 'vite';
const pathResolve = (dir: string): any => {
return resolve(__dirname, '.', dir);
};
-const { VITE_PORT, VITE_OPEN, VITE_PUBLIC_PATH } = loadEnv();
-
const alias: Record = {
'/@': pathResolve('./src/'),
'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js',
};
-export default defineConfig(({ command }: ConfigEnv): UserConfig => {
+const viteConfig = defineConfig((mode: ConfigEnv) => {
+ const env = loadEnv(mode.mode, process.cwd());
return {
plugins: [vue()],
root: process.cwd(),
resolve: { alias },
- base: command === 'build' ? VITE_PUBLIC_PATH : './',
+ base: mode.command === 'serve' ? './' : env.VITE_PUBLIC_PATH,
optimizeDeps: {
include: ['element-plus/lib/locale/lang/zh-cn', 'element-plus/lib/locale/lang/en', 'element-plus/lib/locale/lang/zh-tw'],
},
server: {
host: '0.0.0.0',
- port: VITE_PORT,
- open: VITE_OPEN,
+ port: env.VITE_PORT as unknown as number,
+ open: env.VITE_OPEN,
proxy: {
'/gitee': {
target: 'https://gitee.com',
@@ -87,3 +84,5 @@ export default defineConfig(({ command }: ConfigEnv): UserConfig => {
},
};
});
+
+export default viteConfig;