From a45e64fcb2f66d4582a41068c3c16b6bae428e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?= Date: Wed, 12 Feb 2020 10:01:27 +0800 Subject: [PATCH 1/4] perf: change script-loader to dependencies --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fb1e8d55..448d1ec3 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "nprogress": "0.2.0", "path-to-regexp": "2.4.0", "screenfull": "4.2.0", + "script-loader": "0.7.2", "showdown": "1.9.0", "sortablejs": "1.8.4", "tui-editor": "1.3.3", @@ -96,7 +97,6 @@ "runjs": "^4.3.2", "sass-loader": "^7.1.0", "script-ext-html-webpack-plugin": "2.1.3", - "script-loader": "0.7.2", "serve-static": "^1.13.2", "svg-sprite-loader": "4.1.3", "svgo": "1.2.0", From c2a5a159564d17b982e3903455c20c7b9f65e9bb Mon Sep 17 00:00:00 2001 From: echofly <36875450+echofly@users.noreply.github.com> Date: Wed, 18 Mar 2020 19:22:38 +0800 Subject: [PATCH 2/4] fix[profile/UserCard]: fixed wrong key name (#3056) roles => role --- src/views/profile/components/UserCard.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/profile/components/UserCard.vue b/src/views/profile/components/UserCard.vue index b9a383d6..2476f04a 100644 --- a/src/views/profile/components/UserCard.vue +++ b/src/views/profile/components/UserCard.vue @@ -65,7 +65,7 @@ export default { name: '', email: '', avatar: '', - roles: '' + role: '' } } } From 776f10e19720039d39593064663b618fbdb0e837 Mon Sep 17 00:00:00 2001 From: Aisen60 <1147319086@qq.com> Date: Fri, 20 Mar 2020 21:24:31 +0800 Subject: [PATCH 3/4] fix:fixed parseTime bug in ie and safari(#3066) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * /src/utils/index.js parseTime 添加IE浏览器(版本10以下,包括版本10)兼容。 * perf: update Co-authored-by: aisen60 Co-authored-by: 花裤衩 --- src/utils/index.js | 12 ++++++++++-- tests/unit/utils/parseTime.spec.js | 5 +++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/utils/index.js b/src/utils/index.js index 2684e3c2..eb760d5e 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -17,9 +17,17 @@ export function parseTime(time, cFormat) { if (typeof time === 'object') { date = time } else { - if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { - time = parseInt(time) + if ((typeof time === 'string')) { + if ((/^[0-9]+$/.test(time))) { + // support "1548221490638" + time = parseInt(time) + } else { + // support safari + // https://stackoverflow.com/questions/4310953/invalid-date-in-safari + time = time.replace(new RegExp(/-/gm), '/') + } } + if ((typeof time === 'number') && (time.toString().length === 10)) { time = time * 1000 } diff --git a/tests/unit/utils/parseTime.spec.js b/tests/unit/utils/parseTime.spec.js index 77ecb9d5..bc61d1ac 100644 --- a/tests/unit/utils/parseTime.spec.js +++ b/tests/unit/utils/parseTime.spec.js @@ -4,6 +4,11 @@ describe('Utils:parseTime', () => { it('timestamp', () => { expect(parseTime(d)).toBe('2018-07-13 17:54:01') }) + + it('timestamp string', () => { + expect(parseTime((d + ''))).toBe('2018-07-13 17:54:01') + }) + it('ten digits timestamp', () => { expect(parseTime((d / 1000).toFixed(0))).toBe('2018-07-13 17:54:01') }) From 9e0435ac85da58b74692594be7770c0920cc707d Mon Sep 17 00:00:00 2001 From: echofly <36875450+echofly@users.noreply.github.com> Date: Tue, 24 Mar 2020 10:17:18 +0800 Subject: [PATCH 4/4] perf: format component names as PascalCase (#3074) format: component names should be PascalCase --- src/views/tab/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/tab/index.vue b/src/views/tab/index.vue index 862a160f..2a35fa58 100644 --- a/src/views/tab/index.vue +++ b/src/views/tab/index.vue @@ -13,11 +13,11 @@