-
@@ -108,7 +135,6 @@
-
-
-
From 4342032fb907582fd84626a8aec5345dcc6439f9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?=
Date: Mon, 30 Sep 2019 15:06:42 +0800
Subject: [PATCH 15/24] fix: fixed numberFormatter bug
https://github.com/PanJiaChen/vue-element-admin/issues/2568
---
src/filters/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/filters/index.js b/src/filters/index.js
index f6a28488..98222339 100644
--- a/src/filters/index.js
+++ b/src/filters/index.js
@@ -45,7 +45,7 @@ export function numberFormatter(num, digits) {
]
for (let i = 0; i < si.length; i++) {
if (num >= si[i].value) {
- return (num / si[i].value + 0.1).toFixed(digits).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, '$1') + si[i].symbol
+ return (num / si[i].value).toFixed(digits).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, '$1') + si[i].symbol
}
}
return num.toString()
From d571715c3d943f40af5139c825202b45a9e87ccf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?=
Date: Mon, 30 Sep 2019 16:38:18 +0800
Subject: [PATCH 16/24] fix[example]: fixed create.vue cache error
https://github.com/PanJiaChen/vue-element-admin/issues/2608
---
src/views/example/components/ArticleDetail.vue | 2 --
src/views/example/create.vue | 2 +-
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/views/example/components/ArticleDetail.vue b/src/views/example/components/ArticleDetail.vue
index 3ab0daec..616fd42b 100644
--- a/src/views/example/components/ArticleDetail.vue
+++ b/src/views/example/components/ArticleDetail.vue
@@ -172,8 +172,6 @@ export default {
if (this.isEdit) {
const id = this.$route.params && this.$route.params.id
this.fetchData(id)
- } else {
- this.postForm = Object.assign({}, defaultForm)
}
// Why need to make a copy of this.$route here?
diff --git a/src/views/example/create.vue b/src/views/example/create.vue
index 4d3a24b5..f28ce287 100644
--- a/src/views/example/create.vue
+++ b/src/views/example/create.vue
@@ -6,7 +6,7 @@
import ArticleDetail from './components/ArticleDetail'
export default {
- name: 'CreateForm',
+ name: 'CreateArticle',
components: { ArticleDetail }
}
From 137c1c3eff4b66cd0ec90e379e033ae8eaae0dbb Mon Sep 17 00:00:00 2001
From: monkeycf <41945134+monkeycf@users.noreply.github.com>
Date: Tue, 8 Oct 2019 17:54:47 +0800
Subject: [PATCH 17/24] perf[utils.js]: perf parseTime function (#2625)
---
src/utils/index.js | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/utils/index.js b/src/utils/index.js
index ffb55260..2684e3c2 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -6,7 +6,7 @@
* Parse the time to string
* @param {(Object|string|number)} time
* @param {string} cFormat
- * @returns {string}
+ * @returns {string | null}
*/
export function parseTime(time, cFormat) {
if (arguments.length === 0) {
@@ -34,14 +34,11 @@ export function parseTime(time, cFormat) {
s: date.getSeconds(),
a: date.getDay()
}
- const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
- let value = formatObj[key]
+ const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
+ const value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] }
- if (result.length > 0 && value < 10) {
- value = '0' + value
- }
- return value || 0
+ return value.toString().padStart(2, '0')
})
return time_str
}
From ed0b0237674fac2f12d589da3ef8bc516aa2a857 Mon Sep 17 00:00:00 2001
From: monkeycf <41945134+monkeycf@users.noreply.github.com>
Date: Tue, 8 Oct 2019 18:15:22 +0800
Subject: [PATCH 18/24] perf[tagsView]: pref DEL_CACHED_VIEW and
DEL_OTHERS_CACHED_VIEWS function (#2626)
---
src/store/modules/tagsView.js | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/src/store/modules/tagsView.js b/src/store/modules/tagsView.js
index 3e2c1703..f94546ce 100644
--- a/src/store/modules/tagsView.js
+++ b/src/store/modules/tagsView.js
@@ -28,13 +28,8 @@ const mutations = {
}
},
DEL_CACHED_VIEW: (state, view) => {
- for (const i of state.cachedViews) {
- if (i === view.name) {
- const index = state.cachedViews.indexOf(i)
- state.cachedViews.splice(index, 1)
- break
- }
- }
+ const index = state.cachedViews.indexOf(view.name)
+ index > -1 && state.cachedViews.splice(index, 1)
},
DEL_OTHERS_VISITED_VIEWS: (state, view) => {
@@ -43,13 +38,8 @@ const mutations = {
})
},
DEL_OTHERS_CACHED_VIEWS: (state, view) => {
- for (const i of state.cachedViews) {
- if (i === view.name) {
- const index = state.cachedViews.indexOf(i)
- state.cachedViews = state.cachedViews.slice(index, index + 1)
- break
- }
- }
+ const index = state.cachedViews.indexOf(view.name)
+ index > -1 && (state.cachedViews = state.cachedViews.slice(index, index + 1))
},
DEL_ALL_VISITED_VIEWS: state => {
From 50dcb90b5366a09f0869b9e485077631772071c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?=
Date: Tue, 8 Oct 2019 18:20:11 +0800
Subject: [PATCH 19/24] fix[tagsView]: fixed DEL_OTHERS_CACHED_VIEWS bug
---
src/store/modules/tagsView.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/store/modules/tagsView.js b/src/store/modules/tagsView.js
index f94546ce..57e72421 100644
--- a/src/store/modules/tagsView.js
+++ b/src/store/modules/tagsView.js
@@ -39,7 +39,12 @@ const mutations = {
},
DEL_OTHERS_CACHED_VIEWS: (state, view) => {
const index = state.cachedViews.indexOf(view.name)
- index > -1 && (state.cachedViews = state.cachedViews.slice(index, index + 1))
+ if (index > -1) {
+ state.cachedViews = state.cachedViews.slice(index, index + 1)
+ } else {
+ // if index = -1, there is no cached tags
+ state.cachedViews = []
+ }
},
DEL_ALL_VISITED_VIEWS: state => {
From a3137fb6cbca592c285a93ce16aeb298cace233f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?=
Date: Tue, 8 Oct 2019 20:38:19 +0800
Subject: [PATCH 20/24] fix[logout]: empty tagsview when logout (#2632)
---
src/store/modules/user.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index dbc29003..1391fa4a 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -73,13 +73,18 @@ const actions = {
},
// user logout
- logout({ commit, state }) {
+ logout({ commit, state, dispatch }) {
return new Promise((resolve, reject) => {
logout(state.token).then(() => {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
removeToken()
resetRouter()
+
+ // reset visited views and cached views
+ // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485
+ dispatch('tagsView/delAllViews', null, { root: true })
+
resolve()
}).catch(error => {
reject(error)
From b7c032b509f40f0f8cdf4ac3fb4d9406d59251ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?=
Date: Tue, 8 Oct 2019 21:20:34 +0800
Subject: [PATCH 21/24] fix[TagsView]: fixed toLastView bug (#2634)
---
src/layout/components/TagsView/index.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue
index 19d3083f..1b112317 100644
--- a/src/layout/components/TagsView/index.vue
+++ b/src/layout/components/TagsView/index.vue
@@ -166,7 +166,7 @@ export default {
toLastView(visitedViews, view) {
const latestView = visitedViews.slice(-1)[0]
if (latestView) {
- this.$router.push(latestView)
+ this.$router.push(latestView.fullPath)
} else {
// now the default is to redirect to the home page if there is no tags-view,
// you can adjust it according to your needs.
From ce667850cf80094e40e8ebdbfaa20e1f5b7f1c0c Mon Sep 17 00:00:00 2001
From: MaYuanhai <414199639@qq.com>
Date: Thu, 10 Oct 2019 11:35:48 +0800
Subject: [PATCH 22/24] perf[SvgIcon]: change xlink:href to href(#2645)
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href
---
src/components/SvgIcon/index.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/SvgIcon/index.vue b/src/components/SvgIcon/index.vue
index b07ded2a..9a3318e5 100644
--- a/src/components/SvgIcon/index.vue
+++ b/src/components/SvgIcon/index.vue
@@ -1,7 +1,7 @@
From f5608a75111fa11c4e3811503024569da4457942 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?=
Date: Fri, 11 Oct 2019 13:37:01 +0800
Subject: [PATCH 23/24] fix[TagsView]: fixed click.middle can close affixed tag
bug (#2649)
---
src/layout/components/TagsView/index.vue | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)
diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue
index 1b112317..3c20275b 100644
--- a/src/layout/components/TagsView/index.vue
+++ b/src/layout/components/TagsView/index.vue
@@ -9,27 +9,18 @@
:to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
tag="span"
class="tags-view-item"
- @click.middle.native="closeSelectedTag(tag)"
+ @click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''"
@contextmenu.prevent.native="openMenu(tag,$event)"
>
{{ generateTitle(tag.title) }}
-
+
@@ -80,6 +71,9 @@ export default {
isActive(route) {
return route.path === this.$route.path
},
+ isAffix(tag) {
+ return tag.meta && tag.meta.affix
+ },
filterAffixTags(routes, basePath = '/') {
let tags = []
routes.forEach(route => {
From ae92d6f95e05d9c2a38b3ee0c92d222c55e8227a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?=
Date: Sat, 12 Oct 2019 17:51:26 +0800
Subject: [PATCH 24/24] docs: add job ad
---
src/views/documentation/index.vue | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/views/documentation/index.vue b/src/views/documentation/index.vue
index 32f924c3..d68d19d9 100644
--- a/src/views/documentation/index.vue
+++ b/src/views/documentation/index.vue
@@ -4,6 +4,11 @@
{{ $t('documentation.github') }}
国内文档
+ 内推招聘