Skip to content

Commit 4edc1b6

Browse files
author
xujianhua
committed
elementPlus版本更新 ,插件更新
1 parent 272fe5d commit 4edc1b6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+4506
-6503
lines changed

.eslintrc.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* @Author: your name
33
* @Date: 2021-01-07 09:49:29
4-
* @LastEditTime: 2021-03-11 16:12:27
4+
* @LastEditTime: 2021-08-09 15:49:07
55
* @LastEditors: Please set LastEditors
66
* @Description: In User Settings Edit
77
* @FilePath: \vue3-element-admin\.eslintrc.js
@@ -10,29 +10,29 @@ module.exports = {
1010
root: true,
1111

1212
env: {
13-
node: true
13+
node: true,
1414
},
1515

1616
extends: [
1717
"plugin:vue/vue3-essential",
1818
"eslint:recommended",
19-
"@vue/prettier"
19+
"@vue/prettier",
2020
],
2121

2222
parserOptions: {
23-
parser: "babel-eslint"
23+
parser: "babel-eslint",
2424
},
2525
// "writable" 以允许重写变量,或 "readonly" 不允许重写变量
2626
globals: {
2727
XE: "readonly",
2828
VE_ENV: "readonly",
29-
VE_API: "readonly"
29+
VE_API: "readonly",
3030
},
3131

3232
rules: {
3333
indent: [2, 4, { SwitchCase: 1 }],
34-
"prettier/prettier": [2, { tabWidth: 4 }],
34+
"prettier/prettier": [2, { tabWidth: 4, endOfLine: "auto" }],
3535
"no-console": "off",
36-
"no-debugger": "off"
37-
}
36+
"no-debugger": "off",
37+
},
3838
};

.vscode/settings.json

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
2-
"editor.formatOnSave": true,
3-
"prettier.tabWidth": 4,
4-
"editor.insertSpaces": false,
5-
"prettier.arrowParens": "avoid",
6-
"prettier.trailingComma": "none",
7-
"vetur.format.options.tabSize": 4,
8-
"editor.formatOnPaste": true,
9-
"files.autoSaveDelay": 2000
10-
}
2+
"editor.formatOnSave": true,
3+
"prettier.tabWidth": 4,
4+
"editor.insertSpaces": false,
5+
"vetur.format.options.tabSize": 4,
6+
"editor.formatOnPaste": true,
7+
"files.autoSaveDelay": 2000,
8+
"prettier.endOfLine": "auto"
9+
}

babel.config.js

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* @Author: your name
33
* @Date: 2021-01-07 09:49:29
4-
* @LastEditTime: 2021-03-31 10:01:26
4+
* @LastEditTime: 2021-08-09 11:36:38
55
* @LastEditors: Please set LastEditors
66
* @Description: In User Settings Edit
77
* @FilePath: \vue3-element-admin\babel.config.js
@@ -13,15 +13,12 @@ module.exports = {
1313
"import",
1414
{
1515
libraryName: "element-plus",
16-
customStyleName: name => {
16+
customStyleName: (name) => {
1717
name = name.slice(3);
1818
return `element-plus/packages/theme-chalk/src/${name}.scss`;
19-
}
20-
}
19+
},
20+
},
2121
],
22-
"@vue/babel-plugin-jsx"
23-
// "@babel/plugin-syntax-dynamic-import",
24-
// "syntax-dynamic-import",
25-
// "dynamic-import-node"
26-
]
22+
"@vue/babel-plugin-jsx",
23+
],
2724
};

package-lock.json

+3,946-5,930
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+14-13
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
"lint": "vue-cli-service lint"
99
},
1010
"dependencies": {
11-
"core-js": "^3.15.2",
11+
"core-js": "^3.16.1",
1212
"dayjs": "^1.10.6",
1313
"echarts": "^5.1.2",
14-
"element-plus": "^1.0.2-beta.54",
14+
"element-plus": "^1.0.2-beta.70",
1515
"normalize.css": "^8.0.1",
1616
"nprogress": "^0.2.0",
1717
"qs": "^6.10.1",
18-
"vue": "^3.1.4",
18+
"vue": "^3.1.5",
1919
"vue-router": "^4.0.10",
2020
"vuex": "^4.0.2",
21-
"xe-utils": "^3.3.0",
21+
"xe-utils": "^3.3.1",
2222
"zdog": "^1.1.2"
2323
},
2424
"devDependencies": {
@@ -28,23 +28,24 @@
2828
"@vue/cli-plugin-router": "^4.5.13",
2929
"@vue/cli-plugin-vuex": "^4.5.13",
3030
"@vue/cli-service": "^4.5.13",
31-
"@vue/compiler-sfc": "^3.1.4",
31+
"@vue/compiler-sfc": "^3.1.5",
3232
"@vue/eslint-config-prettier": "^6.0.0",
3333
"axios": "^0.21.1",
3434
"babel-eslint": "^10.1.0",
3535
"babel-plugin-import": "^1.13.3",
36-
"compression-webpack-plugin": "^5.0.2",
37-
"eslint": "^6.7.2",
36+
"compression-webpack-plugin": "^6.1.1",
37+
"eslint": "^7.32.0",
3838
"eslint-plugin-prettier": "^3.4.0",
39-
"eslint-plugin-vue": "^7.12.1",
40-
"lint-staged": "^9.5.0",
39+
"eslint-plugin-vue": "^7.15.1",
40+
"lint-staged": "^11.1.2",
4141
"mockjs": "^1.1.0",
42-
"prettier": "^1.19.1",
43-
"sass": "^1.35.1",
42+
"prettier": "^2.3.2",
43+
"sass": "^1.37.5",
4444
"sass-loader": "^10.2.0",
45-
"uglifyjs-webpack-plugin": "^1.1.2",
45+
"uglifyjs-webpack-plugin": "^2.2.0",
4646
"vue-cli-plugin-axios": "0.0.4",
47-
"vue-cli-plugin-element-plus": "0.0.11"
47+
"vue-cli-plugin-element-plus": "0.0.13",
48+
"webpack": "^4.46.0"
4849
},
4950
"gitHooks": {
5051
"pre-commit": "lint-staged"

src/App.vue

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
11
<!--
22
* @Author: your name
33
* @Date: 2021-01-07 09:49:29
4-
* @LastEditTime: 2021-04-26 13:51:27
4+
* @LastEditTime: 2021-08-09 15:31:43
55
* @LastEditors: Please set LastEditors
66
* @Description: In User Settings Edit
77
* @FilePath: \vue3-element-admin\src\App.vue
88
-->
99
<template>
10-
<router-view></router-view>
10+
<el-config-provider :locale="locale">
11+
<router-view></router-view>
12+
</el-config-provider>
1113
</template>
1214

1315
<script>
16+
import { ElConfigProvider } from "element-plus";
17+
import zhCn from "element-plus/lib/locale/lang/zh-cn";
1418
export default {
15-
name: "App"
19+
components: {
20+
ElConfigProvider,
21+
},
22+
name: "App",
23+
data: () => ({
24+
locale: zhCn,
25+
}),
1626
};
1727
</script>
1828
<style lang="scss" scoped></style>

src/api/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99
const path = require("path");
1010
const fs = require("fs");
11-
const getPathInfo = p => path.parse(p);
11+
const getPathInfo = (p) => path.parse(p);
1212

1313
/**
1414
* @description // 递归读取文件,类似于webpack的require.context()
@@ -23,7 +23,7 @@ function autoLoadFile(directory, useSubdirectories = false, extList = [".js"]) {
2323
// 递归读取文件
2424
function readFileList(directory, useSubdirectories, extList) {
2525
const files = fs.readdirSync(directory);
26-
files.forEach(item => {
26+
files.forEach((item) => {
2727
const fullPath = path.join(directory, item);
2828
const stat = fs.statSync(fullPath);
2929
if (stat.isDirectory() && useSubdirectories) {

src/api/mock-server.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ function registerRoutes(app) {
2020
let mockLastIndex;
2121
let mocksForServer = new Array();
2222
const api = require("./index.js");
23-
Object.keys(api).map(route => {
24-
Object.keys(api[route]).map(item => {
23+
Object.keys(api).map((route) => {
24+
Object.keys(api[route]).map((item) => {
2525
api[route][item].mock &&
2626
mocksForServer.push(
2727
responseFake(
@@ -44,7 +44,7 @@ function registerRoutes(app) {
4444
// console.log(mockRoutesLength,mockLastIndex)
4545
return {
4646
mockRoutesLength,
47-
mockStartIndex: mockLastIndex - mockRoutesLength
47+
mockStartIndex: mockLastIndex - mockRoutesLength,
4848
};
4949
}
5050
// 模拟mock server
@@ -59,12 +59,12 @@ const responseFake = (url, type, respond) => {
5959
respond instanceof Function ? respond(req, res) : respond
6060
)
6161
);
62-
}
62+
},
6363
};
6464
};
6565
// 移除路由
6666
function unregisterRoutes() {
67-
Object.keys(require.cache).forEach(i => {
67+
Object.keys(require.cache).forEach((i) => {
6868
console.log(apiDir, i);
6969
if (i.includes(apiDir)) {
7070
delete require.cache[require.resolve(i)];
@@ -73,12 +73,12 @@ function unregisterRoutes() {
7373
}
7474

7575
// 导出服务器app
76-
module.exports = app => {
76+
module.exports = (app) => {
7777
// 解析post数据
7878
app.use(express.json());
7979
app.use(
8080
express.urlencoded({
81-
extended: true
81+
extended: true,
8282
})
8383
);
8484

@@ -90,7 +90,7 @@ module.exports = app => {
9090
chokidar
9191
.watch(apiDir, {
9292
ignored: /mock-server/,
93-
ignoreInitial: true
93+
ignoreInitial: true,
9494
})
9595
.on("all", (event, path) => {
9696
try {

0 commit comments

Comments
 (0)