From 2584dcce1684a17620dd69468d9719bcc70778a4 Mon Sep 17 00:00:00 2001 From: Pan <panfree23@gmail.com> Date: Mon, 27 May 2019 10:37:00 +0800 Subject: [PATCH 1/7] update github ISSUE_TEMPLATE --- .github/ISSUE_TEMPLATE/question.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index 96be4532..76083546 100755 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -12,3 +12,24 @@ about: Asking questions about use Before asking a question, please make sure that you have tried your best to solve this problem. If it's a code-related issue, please don't just take screenshots. Please provide an online demo to save each other's time. --> + +#### Steps to reproduce(问题复现步骤) +<!-- +1. [xxx] +2. [xxx] +3. [xxxx] +--> + +#### Screenshot or Gif(截图或动态图) + + +#### Link to minimal reproduction(最小可在线还原demo) + +<!-- +Please only use Codepen, JSFiddle, CodeSandbox or a github repo +--> + +#### Other relevant information(格外信息) +- Your OS: +- Node.js version: +- vue-element-admin version: From 5b943d71e974a81d1b5fa7c770db65ba8ebb4b1c Mon Sep 17 00:00:00 2001 From: bpzhang <bpzhang@users.noreply.github.com> Date: Mon, 27 May 2019 15:04:04 +0800 Subject: [PATCH 2/7] chore: add autoprefixer to devDependencies --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index cd1369b8..5ea4a26f 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,7 @@ "@vue/cli-plugin-unit-jest": "3.5.3", "@vue/cli-service": "3.5.3", "@vue/test-utils": "1.0.0-beta.29", + "autoprefixer": "^9.5.1", "babel-core": "7.0.0-bridge.0", "babel-eslint": "10.0.1", "babel-jest": "23.6.0", From e28701cde4646f7224c3a8dd1a7999546bf5d20e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?= <panfree23@gmail.com> Date: Mon, 27 May 2019 15:04:34 +0800 Subject: [PATCH 3/7] perf[Tinymce]: add language option (#2159) --- src/components/Tinymce/index.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Tinymce/index.vue b/src/components/Tinymce/index.vue index a46b37d6..0c6174c4 100644 --- a/src/components/Tinymce/index.vue +++ b/src/components/Tinymce/index.vue @@ -64,7 +64,9 @@ export default { fullscreen: false, languageTypeList: { 'en': 'en', - 'zh': 'zh_CN' + 'zh': 'zh_CN', + 'es': 'es_MX', + 'ja': 'ja' } } }, @@ -114,6 +116,7 @@ export default { const _this = this window.tinymce.init({ selector: `#${this.tinymceId}`, + language: this.languageTypeList['en'], height: this.height, body_class: 'panel-body ', object_resizing: false, From f891202706e389e539fd15b24a9480bbb2794907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?= <panfree23@gmail.com> Date: Mon, 27 May 2019 15:35:07 +0800 Subject: [PATCH 4/7] fix[Tinymce]: fixed bug when init multiple tinymces at the same time (#2152) --- src/components/Tinymce/dynamicLoadScript.js | 34 ++++++++++++++++----- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/src/components/Tinymce/dynamicLoadScript.js b/src/components/Tinymce/dynamicLoadScript.js index 46a93290..185f58dc 100644 --- a/src/components/Tinymce/dynamicLoadScript.js +++ b/src/components/Tinymce/dynamicLoadScript.js @@ -1,3 +1,11 @@ +let callbacks = [] + +function loadedTinymce() { + // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2144 + // check is successfully downloaded script + return window.tinymce +} + const dynamicLoadScript = (src, callback) => { const existingScript = document.getElementById(src) const cb = callback || function() {} @@ -7,19 +15,28 @@ const dynamicLoadScript = (src, callback) => { script.src = src // src url for the third-party library being loaded. script.id = src document.body.appendChild(script) - + callbacks.push(cb) const onEnd = 'onload' in script ? stdOnEnd : ieOnEnd - onEnd(script, cb) + onEnd(script) } - if (existingScript && cb) cb(null, existingScript) + if (existingScript && cb) { + if (loadedTinymce()) { + cb(null, existingScript) + } else { + callbacks.push(cb) + } + } - function stdOnEnd(script, cb) { + function stdOnEnd(script) { script.onload = function() { // this.onload = null here is necessary // because even IE9 works not like others this.onerror = this.onload = null - cb(null, script) + for (const cb of callbacks) { + cb(null, script) + } + callbacks = null } script.onerror = function() { this.onerror = this.onload = null @@ -27,11 +44,14 @@ const dynamicLoadScript = (src, callback) => { } } - function ieOnEnd(script, cb) { + function ieOnEnd(script) { script.onreadystatechange = function() { if (this.readyState !== 'complete' && this.readyState !== 'loaded') return this.onreadystatechange = null - cb(null, script) // there is no way to catch loading errors in IE8 + for (const cb of callbacks) { + cb(null, script) // there is no way to catch loading errors in IE8 + } + callbacks = null } } } From e8837d161ee2a4793bdf5add1503d472857f6f42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?= <panfree23@gmail.com> Date: Mon, 27 May 2019 15:48:45 +0800 Subject: [PATCH 5/7] feat: add tab url demo (#2114) --- src/layout/components/AppMain.vue | 2 +- src/views/tab/index.vue | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index 9e12c662..a8976380 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -16,7 +16,7 @@ export default { return this.$store.state.tagsView.cachedViews }, key() { - return this.$route.fullPath + return this.$route.path } } } diff --git a/src/views/tab/index.vue b/src/views/tab/index.vue index e5746580..6438a47a 100644 --- a/src/views/tab/index.vue +++ b/src/views/tab/index.vue @@ -30,6 +30,18 @@ export default { createdTimes: 0 } }, + watch: { + activeName(val) { + this.$router.push(`${this.$route.path}?tab=${val}`) + } + }, + created() { + // init the default selected tab + const tab = this.$route.query.tab + if (tab) { + this.activeName = tab + } + }, methods: { showCreatedTimes() { this.createdTimes = this.createdTimes + 1 From ac8c12c82d1ceb15d78454fbdc0fc98458393304 Mon Sep 17 00:00:00 2001 From: Serge <gaosj1993@foxmail.com> Date: Mon, 27 May 2019 16:24:47 +0800 Subject: [PATCH 6/7] perf[request.js]: refine error reject (#2160) --- src/utils/request.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index bc346a8c..71d5ea4b 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -48,7 +48,7 @@ service.interceptors.response.use( // if the custom code is not 20000, it is judged as an error. if (res.code !== 20000) { Message({ - message: res.message || 'error', + message: res.message || 'Error', type: 'error', duration: 5 * 1000 }) @@ -66,7 +66,7 @@ service.interceptors.response.use( }) }) } - return Promise.reject(res.message || 'error') + return Promise.reject(new Error(res.message || 'Error')) } else { return res } From 054ed40e076dc6fa6e707e7020698643b407b9f2 Mon Sep 17 00:00:00 2001 From: Pan <panfree23@gmail.com> Date: Mon, 27 May 2019 16:25:37 +0800 Subject: [PATCH 7/7] [release] 4.2.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5ea4a26f..8fbbf88e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-element-admin", - "version": "4.2.0", + "version": "4.2.1", "description": "A magical vue admin. An out-of-box UI solution for enterprise applications. Newest development stack of vue. Lots of awesome features", "author": "Pan <panfree23@gmail.com>", "license": "MIT",