Skip to content

Commit 9ccd2e1

Browse files
committed
feat: 升级 Element Plus 版本至最新版2.3.0、升级 Vite 版本至3.2.5、及其它依赖升级最新版
1 parent 1e28f50 commit 9ccd2e1

File tree

16 files changed

+1587
-1404
lines changed

16 files changed

+1587
-1404
lines changed

package.json

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,30 @@
3131
"prepare": "husky install"
3232
},
3333
"dependencies": {
34-
"@element-plus/icons-vue": "^2.0.6",
35-
"@iconify/iconify": "^2.2.1",
36-
"@vueuse/core": "^8.9.0",
37-
"@zxcvbn-ts/core": "^2.0.1",
38-
"axios": "^0.27.2",
39-
"echarts": "^5.3.3",
40-
"element-plus": "^2.2.9",
41-
"intro.js": "^4.3.0",
34+
"@element-plus/icons-vue": "^2.1.0",
35+
"@iconify/iconify": "^3.1.0",
36+
"@vueuse/core": "^9.13.0",
37+
"@zxcvbn-ts/core": "^2.2.1",
38+
"axios": "^1.3.4",
39+
"dayjs": "^1.11.7",
40+
"echarts": "^5.4.1",
41+
"element-plus": "^2.3.0",
42+
"intro.js": "^6.0.0",
4243
"lodash-es": "^4.17.21",
4344
"mockjs": "^1.1.0",
4445
"nprogress": "^0.2.0",
4546
"path-to-regexp": "^6.2.1",
46-
"pinia": "^2.0.14",
47+
"pinia": "^2.0.33",
4748
"print-js": "^1.6.0",
4849
"resize-observer-polyfill": "^1.5.1",
49-
"vue": "^3.2.37",
50-
"vue-router": "^4.1.1"
50+
"vue": "^3.2.47",
51+
"vue-router": "^4.1.6"
5152
},
5253
"devDependencies": {
53-
"@commitlint/cli": "^16.0.1",
54-
"@commitlint/config-conventional": "^16.0.0",
55-
"@iconify/json": "^1.1.453",
56-
"@purge-icons/generated": "^0.8.1",
54+
"@commitlint/cli": "^17.4.4",
55+
"@commitlint/config-conventional": "^17.4.4",
56+
"@iconify/json": "^2.2.34",
57+
"@purge-icons/generated": "^0.9.0",
5758
"@types/fs-extra": "^9.0.13",
5859
"@types/intro.js": "^3.0.2",
5960
"@types/lodash-es": "^4.17.6",
@@ -62,17 +63,18 @@
6263
"@types/nprogress": "^0.2.0",
6364
"@typescript-eslint/eslint-plugin": "^5.45.0",
6465
"@typescript-eslint/parser": "^5.45.0",
65-
"@vitejs/plugin-legacy": "1.7.1",
66+
"@vitejs/plugin-legacy": "^4.0.1",
6667
"@vitejs/plugin-vue": "2.3.2",
6768
"@vitejs/plugin-vue-jsx": "1.3.10",
6869
"@vue/eslint-config-prettier": "^7.0.0",
6970
"@vue/test-utils": "^2.0.2",
70-
"autoprefixer": "^10.4.1",
71-
"commitizen": "^4.2.4",
71+
"autoprefixer": "^10.4.14",
72+
"browserslist": "^4.21.5",
73+
"caniuse-lite": "^1.0.30001466",
74+
"commitizen": "^4.3.0",
7275
"conventional-changelog-cli": "^2.2.2",
7376
"cross-env": "^7.0.3",
7477
"css-properties-sorting": "^1.0.10",
75-
"dayjs": "^1.11.1",
7678
"dotenv": "^10.0.0",
7779
"eslint": "^8.20.0",
7880
"eslint-config-prettier": "^8.5.0",
@@ -82,10 +84,8 @@
8284
"esno": "^0.13.0",
8385
"fs-extra": "^10.0.0",
8486
"http-server": "^14.0.0",
85-
"husky": "^7.0.4",
86-
"lint-staged": "^12.1.5",
87-
"node-sass": "^7.0.1",
88-
"npm-run-all": "^4.1.5",
87+
"husky": "^8.0.3",
88+
"lint-staged": "^13.2.0",
8989
"postcss": "^8.4.5",
9090
"postcss-html": "^1.5.0",
9191
"postcss-scss": "^4.0.2",
@@ -103,7 +103,7 @@
103103
"stylelint-scss": "^4.3.0",
104104
"ts-node": "^10.9.1",
105105
"typescript": "^4.8.4",
106-
"vite": "^2.9.13",
106+
"vite": "3.2.5",
107107
"vite-plugin-compression": "^0.5.1",
108108
"vite-plugin-html": "^3.2.0",
109109
"vite-plugin-imagemin": "^0.6.1",
@@ -114,9 +114,9 @@
114114
"vite-plugin-pwa": "^0.12.2",
115115
"vite-plugin-style-import": "^2.0.0",
116116
"vite-plugin-svg-icons": "^2.0.1",
117-
"vue-component-meta": "^1.0.9",
117+
"vue-component-meta": "^1.2.0",
118118
"vue-eslint-parser": "^9.1.0",
119-
"vue-tsc": "^1.0.9",
119+
"vue-tsc": "^1.2.0",
120120
"workbox-build": "^6.5.4",
121121
"workbox-window": "^6.5.4"
122122
},
@@ -153,9 +153,8 @@
153153
"echarts/core",
154154
"echarts/renderers",
155155
"element-plus",
156-
"element-plus/es/components/dropdown/src/dropdown",
157-
"element-plus/es/components/table/src/table-column/defaults",
158-
"element-plus/es/components/table/src/table/defaults",
156+
"element-plus/lib/components/table/src/table-column/defaults",
157+
"element-plus/lib/components/table/src/table/defaults",
159158
"element-plus/lib/locale/lang/zh-cn",
160159
"intro.js",
161160
"lodash",

src/App.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<ElConfigProvider :locale="zhCn">
2+
<ElConfigProvider :locale="locale">
33
<AppProvider>
44
<RouterView />
55
</AppProvider>
@@ -13,10 +13,12 @@ import { AppProvider } from '@/components/Application'
1313
import { useTitle } from '@/hooks/web/useTitle'
1414
// 默认载入了Element Plus的中文
1515
// The Chinese of Element Plus is loaded by default
16-
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
16+
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
1717
1818
useTitle()
1919
20+
const locale = zhCn
21+
2022
let isProdEnv = false
2123
try {
2224
isProdEnv = process.env.NODE_ENV === 'production'

src/components/BasicDrawer/src/BasicDrawer.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,12 @@ export default defineComponent({
9292
...props,
9393
...(unref(propsRef) as Recordable),
9494
} as BasicDrawerProps
95+
const className = `${prefixCls} ${opts?.class || ''} ${prefixCls}-${instance?.uid}`
9596
9697
return {
9798
...opts,
98-
customClass: `${prefixCls} ${opts?.customClass || ''} ${prefixCls}-${instance?.uid}`,
99+
class: className,
100+
// customClass: className, // compatible
99101
}
100102
})
101103

src/components/BasicModal/src/BasicModal.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ export default defineComponent({
107107
...unref(getProps),
108108
fullscreen: unref(fullscreenRef),
109109
}
110-
opts.customClass = `${prefixCls} ${opts?.customClass || ''} ${prefixCls}-${instance?.uid}`
110+
const className = `${prefixCls} ${opts?.class || ''} ${prefixCls}-${instance?.uid}`
111+
opts.class = className
112+
// opts.customClass = className // compatible
111113
112114
// 绑定组件Porps前,移除自定义附加项
113115
// Before binding component Porps, remove custom add-ons

src/components/BasicTable/src/components/TablePagination.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<script lang="ts">
1212
import { defineComponent, computed, ref, unref, watch, watchEffect } from 'vue'
1313
import { ElPagination } from 'element-plus'
14-
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
14+
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
1515
import { omit } from 'lodash-es'
1616
1717
import { PAGE_SIZE, PAGE_POSITION_ALIGN } from '../const'

src/components/BasicUpload/src/components/PreviewModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:width="800"
66
:close-on-click-modal="false"
77
:close-on-press-escape="false"
8-
:custom-class="prefixCls"
8+
:class="prefixCls"
99
@register="register"
1010
:showCancelBtn="false"
1111
:showConfirmBtn="false">

src/components/BasicUpload/src/components/UploadModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
v-bind="$attrs"
55
:close-on-click-modal="false"
66
:close-on-press-escape="false"
7-
custom-class="upload-modal"
7+
class="upload-modal"
88
@register="register"
99
@confirm="handleConfirm"
1010
:closeFn="handleCloseFn"

src/components/ElementPlus/README.MD

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Element Plus Types and Props
32

4-
Sync Ver: `2.1.7`
3+
Sync Ver: `2.3.0`

src/components/ElementPlus/index.ts

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import type {
1919
PaginationProps,
2020
FormItemRule,
2121
FormRules,
22-
ComponentSize,
2322
PopconfirmProps,
23+
TableProps,
2424
ElMessageBoxOptions,
2525
NotificationOptions,
2626
Action,
@@ -41,7 +41,7 @@ import {
4141
paginationProps,
4242
popconfirmProps,
4343
notificationProps,
44-
componentSizes,
44+
descriptionProps,
4545
formProps,
4646
formItemProps,
4747
dropdownMenuProps,
@@ -92,14 +92,12 @@ export type EleNotification = NotificationOptions
9292

9393
export const EleFormProps = formProps
9494
export type EleForm = FormProps
95+
export type EleFormRules = FormRules
9596

9697
export const EleFormItemProps = formItemProps
9798
export type EleFormItem = FormItemProps
98-
9999
export type EleFormItemRule = FormItemRule
100100

101-
export type EleFormRules = FormRules
102-
103101
export const EleDropdownProps = dropdownProps
104102
export type EleDropdown = ExtractPropTypes<typeof dropdownProps>
105103

@@ -109,43 +107,18 @@ export type EleDropdownMenu = ExtractPropTypes<typeof dropdownMenuProps>
109107
export const EleDropdownItemProps = dropdownItemProps
110108
export type EleDropdownItem = ExtractPropTypes<typeof dropdownItemProps>
111109

110+
export const EleDescriptionsProps = descriptionProps
111+
export type EleDescriptions = ExtractPropTypes<typeof descriptionProps>
112+
112113
//
113114
// 杂项
114115
// MISC
115116
export type EleActionPopconfirmAction = Action
116117

117118
// 以下为临时方案,由于 Element Plus 未全局导出 Prop ,只能自建或通过引入组件方式定义组件 Prop
118119
// The following is a temporary solution. Since Element Plus does not export Prop globally, it can only define component Prop by itself or by introducing components
119-
import TableDefault from 'element-plus/es/components/table/src/table/defaults'
120-
import TableColumn from 'element-plus/es/components/table/src/table-column/defaults'
121-
122-
export const EleDescriptionsProps = {
123-
border: {
124-
type: Boolean,
125-
default: false,
126-
},
127-
column: {
128-
type: Number,
129-
default: 3,
130-
},
131-
direction: {
132-
type: String as PropType<'horizontal' | 'vertical'>,
133-
default: 'horizontal',
134-
},
135-
size: {
136-
type: String as PropType<ComponentSize>,
137-
validator: (v: string) => componentSizes.includes(v),
138-
},
139-
title: {
140-
type: String,
141-
default: '',
142-
},
143-
extra: {
144-
type: String,
145-
default: '',
146-
},
147-
}
148-
export type EleDescriptions = ExtractPropTypes<typeof EleDescriptionsProps>
120+
import TableDefault from 'element-plus/lib/components/table/src/table/defaults'
121+
import TableColumn from 'element-plus/lib/components/table/src/table-column/defaults'
149122

150123
export const EleDescriptionsItemProps = {
151124
label: {
@@ -184,7 +157,7 @@ export const EleDescriptionsItemProps = {
184157
export type EleDescriptionsItem = Partial<ExtractPropTypes<typeof EleDescriptionsItemProps>>
185158

186159
export const EleTableProps = TableDefault
187-
export type EleTable = Partial<ExtractPropTypes<typeof TableDefault>>
160+
export type EleTable = TableProps
188161

189162
export const EleTableColumnProps = TableColumn
190163
export type EleTableColumn = Partial<ExtractPropTypes<typeof TableColumn>>

src/hooks/web/useMessage.tsx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ interface BasicMessageOptions {
3636
*
3737
* Custom popup class
3838
*/
39-
customClass?: string
39+
class?: string
4040
/**
4141
* 消息支持的类型
4242
*
@@ -98,12 +98,14 @@ export function useMessage() {
9898
* @param options NotificationOptions
9999
*/
100100
function createNotification(options: NotificationOptions): Promise<EleActionPopconfirmAction> {
101-
const { title, content, message, position = 'top-right', customClass, type, duration = 4500 } = options
101+
const { title, content, message, position = 'top-right', type, duration = 4500 } = options
102+
const className = options.class || null
102103

103104
return ElNotification({
104105
title,
105106
message: content || message,
106-
customClass,
107+
class: className,
108+
// customClass: className, // compatible
107109
type,
108110
position,
109111
duration,
@@ -117,14 +119,16 @@ export function useMessage() {
117119
* @param options MessageBoxOptions
118120
*/
119121
function createConfirm(options: MessageBoxOptions): Promise<EleActionPopconfirmAction> {
120-
const { title, content, message, confirmText = '确认', cancelText = '取消', customClass = '', type } = options
122+
const { title, content, message, confirmText = '确认', cancelText = '取消', type } = options
121123
const { prefixCls } = useDesign('confirm-popup')
124+
const className = `${prefixCls} ${prefixCls}__${type} ${options.class || ''}`
122125

123126
return ElMessageBox.confirm(content || message, title, {
124127
confirmButtonText: confirmText,
125128
cancelButtonText: cancelText,
126129
showClose: false,
127-
customClass: `${prefixCls} ${prefixCls}__${type} ${customClass}`,
130+
class: className,
131+
// customClass: className, // compatible
128132
})
129133
}
130134

@@ -136,13 +140,15 @@ export function useMessage() {
136140
* @param type EleElMessageBox['type']
137141
*/
138142
function createModalOptions(options: MessageBoxOptions, type: EleElMessageBox['type']): Promise<EleActionPopconfirmAction> {
139-
const { title, content, message, confirmText, cancelText, customClass } = options
143+
const { title, content, message, confirmText, cancelText } = options
144+
const className = options.class || null
140145

141146
return ElMessageBox.alert(content || message, title, {
142147
confirmButtonText: confirmText || '确认',
143148
cancelButtonText: cancelText || '取消',
144149
type,
145-
customClass,
150+
class: className,
151+
// customClass: className, // compatible
146152
})
147153
}
148154

@@ -196,7 +202,8 @@ export function useMessage() {
196202
const createLoading = (title: string, duration = 0) =>
197203
ElMessage({
198204
type: 'info',
199-
customClass: 'el-message--loading',
205+
class: 'el-message--loading',
206+
// customClass: 'el-message--loading', // compatible
200207
duration, // If 0, you need to run ElMessage.closeAll() to close
201208
message: h('div', { style: 'display:flex;align-items:center;' }, [h(SvgIcon, { name: 'loading', spin: true }), h('span', { style: 'margin-left: 12px' }, title)]),
202209
})

src/layouts/default/header/components/lock/LockModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@register="register"
55
:width="600"
66
:showFooter="false"
7-
:custom-class="prefixCls">
7+
:class="prefixCls">
88
<div :class="`${prefixCls}__entry`">
99
<div :class="`${prefixCls}__header`">
1010
<img :src="avatar" :class="`${prefixCls}__header-img`" />

src/layouts/default/header/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ $prefix-cls: '#{$tonyname}-layout-header';
8282

8383
&-action {
8484
display: flex;
85+
justify-content: flex-end;
8586
align-items: center;
8687
min-width: 180px;
8788

src/layouts/default/setting/SettingDrawer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export default defineComponent({
224224
}
225225

226226
return () => (
227-
<BasicDrawer {...attrs} title={'项目配置'} size={480} showFooter customClass='setting-drawer'>
227+
<BasicDrawer {...attrs} title={'项目配置'} size={480} showFooter class='setting-drawer'>
228228
{{
229229
default: () => (
230230
<>

0 commit comments

Comments
 (0)