Skip to content

Commit 578e09f

Browse files
authored
升级vue以及element-plus到最新版本 (#523)
Co-authored-by: liulihan <[email protected]>
1 parent dc62015 commit 578e09f

File tree

9 files changed

+25
-17
lines changed

9 files changed

+25
-17
lines changed

Diff for: babel.config.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
module.exports = {
22
presets: [['@vue/cli-plugin-babel/preset']],
33
plugins: [
4-
[
5-
'component',
6-
{
7-
libraryName: 'element-plus',
8-
styleLibraryName: 'theme-chalk',
9-
},
10-
],
4+
//去除element babel 新版直接手动导入即可
115
'@babel/plugin-proposal-optional-chaining',
126
'@babel/plugin-proposal-nullish-coalescing-operator',
137
],

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"axios": "^0.21.1",
2020
"core-js": "^3.6.5",
2121
"dayjs": "^1.10.4",
22-
"element-plus": "^1.0.2-beta.70",
22+
"element-plus": "^1.2.0-beta.5",
2323
"event-source-polyfill": "^1.0.7",
2424
"fastscan": "^1.0.4",
2525
"good-storage": "^1.1.0",
@@ -30,7 +30,7 @@
3030
"photoswipe": "^4.1.2",
3131
"screenfull": "^4.2.0",
3232
"swiper": "^6.4.5",
33-
"vue": "^3.1.4",
33+
"vue": "^3.2.24",
3434
"vue-picture-cropper": "^0.1.9",
3535
"vue-router": "^4.0.10",
3636
"vuex": "^4.0.2",

Diff for: src/assets/style/elementFont.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/assets/style/fonts/element-icons.ttf

49.2 KB
Binary file not shown.

Diff for: src/assets/style/fonts/element-icons.woff

24.2 KB
Binary file not shown.

Diff for: src/assets/style/realize/element-variable.scss

+5-4
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ $--background-color-base: #F6F7FA !default;
1919
$--link-default-active-color: $--color-primary !default;
2020
$--link-default-font-color: $--color-text-regular !default;
2121
$--link-disabled-font-color: $--color-text-placeholder !default;
22-
2322
/* 改变 icon 字体路径变量,必需 */
24-
$--font-path: "~element-plus/lib/theme-chalk/fonts";
25-
26-
@import "~element-plus/packages/theme-chalk/src/index";
23+
//$--font-path: "~element-plus/lib/theme-chalk/fonts";
24+
//兼容字体 新版本element-plus 已经移除font-icon
25+
@import "../elementFont.css";
26+
@import "~element-plus/theme-chalk/src/index";
27+
@import "~element-plus/theme-chalk/src/mixins/mixins";
2728

2829
// button
2930
.el-button {

Diff for: src/component/layout/sidebar/menu-tree.vue

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<template>
2-
<el-submenu v-if="item.children?.length > 0" :index="item.path" popper-append-to-body>
2+
<!--el-submenu改名为el-sub-menu-->
3+
<el-sub-menu v-if="item.children?.length > 0" :index="item.path" popper-append-to-body>
34
<template #title>
45
<i v-if="!filterIcon(item.icon)" :class="item.icon"></i>
56
<img v-else :src="item.icon" class="img-icon" />
67
<span>{{ item.title }}</span>
78
</template>
89
<menu-tree v-for="child in item.children" :key="child.path" :item="child" />
9-
</el-submenu>
10+
</el-sub-menu>
1011

1112
<el-menu-item v-else :index="item.path" @click="navigateTo(item.path)">
1213
<i v-if="!filterIcon(item.icon)" :class="item.icon"></i>
@@ -47,12 +48,14 @@ export default {
4748
display: inline-block;
4849
transform: translateY(21px);
4950
}
51+
5052
.iconfont {
5153
margin-right: 10px;
5254
margin-left: 5px;
5355
color: $sub-menu-title;
5456
height: $menu-item-height;
5557
}
58+
5659
.title {
5760
display: inline-block;
5861
width: 110px;

Diff for: src/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import StickyTop from '@/component/base/sticky-top/sticky-top'
1818
import SourceCode from '@/component/base/source-code/source-code'
1919

2020
import '@/assets/style/index.scss'
21-
import 'element-plus/lib/theme-chalk/index.css'
21+
import 'element-plus/dist/index.css'
2222
import '@/assets/style/realize/element-variable.scss'
2323

2424
const app = createApp(App)

Diff for: vue.config.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function resolve(dir) {
55
}
66

77
module.exports = {
8-
lintOnSave: true,
8+
lintOnSave: false,
99
productionSourceMap: false,
1010
// assetsDir: 'static',
1111
chainWebpack: config => {
@@ -27,6 +27,15 @@ module.exports = {
2727
resolve: {
2828
extensions: ['.js', '.json', '.vue', '.scss', '.html'],
2929
},
30+
module: {
31+
rules: [
32+
{
33+
test: /\.mjs$/,
34+
include: /node_modules/,
35+
type: 'javascript/auto',
36+
},
37+
],
38+
},
3039
},
3140
css: {
3241
loaderOptions: {

0 commit comments

Comments
 (0)