Skip to content

Commit 4b442a7

Browse files
committed
feat: Remove vue-moment dependency, use moment library directly
1 parent 43f9b8c commit 4b442a7

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
"vue-i18n": "^8.15.5",
7777
"vue-json-editor": "^1.4.3",
7878
"vue-markdown": "^2.2.4",
79-
"vue-moment": "^4.1.0",
8079
"vue-password-strength-meter": "^1.7.2",
8180
"vue-router": "3.0.6",
8281
"vue-select": "^3.9.5",

src/main.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ import { message } from '@/utils/message'
2424
import xss from '@/utils/xss'
2525
import ElTableTooltipPatch from '@/utils/elTableTooltipPatch.js'
2626
import VSanitize from 'v-sanitize'
27+
import moment from 'moment'
28+
moment.locale('zh-cn')
29+
2730
/**
2831
* If you don't want to use mock-server
2932
* you want to use MockJs for mock api
@@ -50,11 +53,7 @@ Vue.config.productionTip = false
5053
Vue.use(VueCookie)
5154
window.$cookie = VueCookie
5255

53-
const moment = require('moment')
54-
require('moment/locale/zh-cn')
55-
Vue.use(require('vue-moment'), {
56-
moment
57-
})
56+
Vue.prototype.$moment = moment
5857

5958
Vue.use(VueLogger, loggerOptions)
6059

yarn.lock

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8914,7 +8914,7 @@ moment-parseformat@^4.0.0:
89148914
resolved "https://registry.npmmirror.com/moment-parseformat/-/moment-parseformat-4.0.0.tgz"
89158915
integrity sha512-0V4ICKnI1npglqrMSDK2y8WxOdN79DkMoIexzY3P+jr2wNfbB4J81BgjFfHsj18wBsV7FdKCWyCHcezzH0xlyg==
89168916

8917-
moment@^2.19.2, moment@^2.29.4:
8917+
moment@^2.29.4:
89188918
version "2.29.4"
89198919
resolved "https://registry.npmmirror.com/moment/-/moment-2.29.4.tgz"
89208920
integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==
@@ -12075,7 +12075,7 @@ string-length@^2.0.0:
1207512075
astral-regex "^1.0.0"
1207612076
strip-ansi "^4.0.0"
1207712077

12078-
"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
12078+
"string-width-cjs@npm:string-width@^4.2.0":
1207912079
version "4.2.3"
1208012080
resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz"
1208112081
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -12093,6 +12093,15 @@ string-width@^1.0.1:
1209312093
is-fullwidth-code-point "^1.0.0"
1209412094
strip-ansi "^3.0.0"
1209512095

12096+
"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
12097+
version "4.2.3"
12098+
resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz"
12099+
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
12100+
dependencies:
12101+
emoji-regex "^8.0.0"
12102+
is-fullwidth-code-point "^3.0.0"
12103+
strip-ansi "^6.0.1"
12104+
1209612105
string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1:
1209712106
version "2.1.1"
1209812107
resolved "https://registry.npmmirror.com/string-width/-/string-width-2.1.1.tgz"
@@ -12193,7 +12202,7 @@ stringify-package@^1.0.1:
1219312202
resolved "https://registry.npmjs.org/stringify-package/-/stringify-package-1.0.1.tgz"
1219412203
integrity sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg==
1219512204

12196-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
12205+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
1219712206
version "6.0.1"
1219812207
resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz"
1219912208
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -12221,6 +12230,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0:
1222112230
dependencies:
1222212231
ansi-regex "^4.1.0"
1222312232

12233+
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
12234+
version "6.0.1"
12235+
resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz"
12236+
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
12237+
dependencies:
12238+
ansi-regex "^5.0.1"
12239+
1222412240
strip-ansi@^7.0.1, strip-ansi@^7.1.0:
1222512241
version "7.1.0"
1222612242
resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-7.1.0.tgz"
@@ -13215,13 +13231,6 @@ vue-markdown@^2.2.4:
1321513231
markdown-it-task-lists "^2.0.1"
1321613232
markdown-it-toc-and-anchor "^4.1.2"
1321713233

13218-
vue-moment@^4.1.0:
13219-
version "4.1.0"
13220-
resolved "https://registry.npmmirror.com/vue-moment/-/vue-moment-4.1.0.tgz"
13221-
integrity sha512-Gzisqpg82ItlrUyiD9d0Kfru+JorW2o4mQOH06lEDZNgxci0tv/fua1Hl0bo4DozDV2JK1r52Atn/8QVCu8qQw==
13222-
dependencies:
13223-
moment "^2.19.2"
13224-
1322513234
vue-password-strength-meter@^1.7.2:
1322613235
version "1.7.2"
1322713236
resolved "https://registry.npmmirror.com/vue-password-strength-meter/-/vue-password-strength-meter-1.7.2.tgz"

0 commit comments

Comments
 (0)