From aa9d48905f9f12e292038f8eeb0b27c003ae61f7 Mon Sep 17 00:00:00 2001 From: Pan Date: Wed, 10 Apr 2019 15:54:47 +0800 Subject: [PATCH 01/16] [release] 4.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1b59855b..72e92927 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-element-admin", - "version": "4.0.0", + "version": "4.0.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 ", "license": "MIT", From 035c7d78f18b23d33ffadf47d97da91c00e1f2fe Mon Sep 17 00:00:00 2001 From: Pan Date: Thu, 11 Apr 2019 09:42:44 +0800 Subject: [PATCH 02/16] docs: change some http links to https --- .editorconfig | 2 +- README.md | 10 +++++----- README.zh-CN.md | 8 ++++---- mock/mock-server.js | 2 +- src/views/components-demo/splitpane.vue | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.editorconfig b/.editorconfig index ea6e20f5..3454886e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,4 @@ -# http://editorconfig.org +# https://editorconfig.org root = true [*] diff --git a/README.md b/README.md index 48599a7e..b8b8447d 100644 --- a/README.md +++ b/README.md @@ -30,11 +30,11 @@ English | [简体中文](./README.zh-CN.md) ## Introduction -[vue-element-admin](http://panjiachen.github.io/vue-element-admin) is a production-ready front-end solution for admin interfaces. It based on [vue](https://github.com/vuejs/vue) and use the UI Toolkit [element-ui](https://github.com/ElemeFE/element). +[vue-element-admin](https://panjiachen.github.io/vue-element-admin) is a production-ready front-end solution for admin interfaces. It based on [vue](https://github.com/vuejs/vue) and use the UI Toolkit [element-ui](https://github.com/ElemeFE/element). It is a magical vue admin based on the newest development stack of vue, built-in i18n solution, typical templates for enterprise applications, lots of awesome features. It helps you build a large complex Single-Page Applications. I believe whatever your needs are, this project will help you. -- [Preview](http://panjiachen.github.io/vue-element-admin) +- [Preview](https://panjiachen.github.io/vue-element-admin) - [Documentation](https://panjiachen.github.io/vue-element-admin-site/) @@ -56,7 +56,7 @@ It is a magical vue admin based on the newest development stack of vue, built-in ## Preparation -You need to install [node](http://nodejs.org/) and [git](https://git-scm.com/) locally. The project is based on [ES2015+](http://es6.ruanyifeng.com/), [vue](https://cn.vuejs.org/index.html), [vuex](https://vuex.vuejs.org/zh-cn/), [vue-router](https://router.vuejs.org/zh-cn/), [vue-cli](https://github.com/vuejs/vue-cli) , [axios](https://github.com/axios/axios) and [element-ui](https://github.com/ElemeFE/element), all request data is simulated using [Mock.js](https://github.com/nuysoft/Mock). +You need to install [node](https://nodejs.org/) and [git](https://git-scm.com/) locally. The project is based on [ES2015+](https://es6.ruanyifeng.com/), [vue](https://cn.vuejs.org/index.html), [vuex](https://vuex.vuejs.org/zh-cn/), [vue-router](https://router.vuejs.org/zh-cn/), [vue-cli](https://github.com/vuejs/vue-cli) , [axios](https://github.com/axios/axios) and [element-ui](https://github.com/ElemeFE/element), all request data is simulated using [Mock.js](https://github.com/nuysoft/Mock). Understanding and learning this knowledge in advance will greatly help the use of this project.

@@ -187,7 +187,7 @@ Detailed changes for each release are documented in the [release notes](https:// ## Online Demo -[Preview](http://panjiachen.github.io/vue-element-admin) +[Preview](https://panjiachen.github.io/vue-element-admin) ## Donate @@ -203,7 +203,7 @@ If you find this project useful, you can buy author a glass of juice :tropical_d Modern browsers and Internet Explorer 10+. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | +| [IE / Edge](https://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](https://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](https://godban.github.io/browsers-support-badges/)
Chrome | [Safari](https://godban.github.io/browsers-support-badges/)
Safari | | --------- | --------- | --------- | --------- | | IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions diff --git a/README.zh-CN.md b/README.zh-CN.md index e0ec09bb..21d1eb7b 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -30,9 +30,9 @@ ## 简介 -[vue-element-admin](http://panjiachen.github.io/vue-element-admin) 是一个后台前端解决方案,它基于 [vue](https://github.com/vuejs/vue) 和 [element-ui](https://github.com/ElemeFE/element)实现。它使用了最新的前端技术栈,内置了 i18n 国际化解决方案,动态路由,权限验证,提炼了典型的业务模型,提供了丰富的功能组件,它可以帮助你快速搭建企业级中后台产品原型。相信不管你的需求是什么,本项目都能帮助到你。 +[vue-element-admin](https://panjiachen.github.io/vue-element-admin) 是一个后台前端解决方案,它基于 [vue](https://github.com/vuejs/vue) 和 [element-ui](https://github.com/ElemeFE/element)实现。它使用了最新的前端技术栈,内置了 i18n 国际化解决方案,动态路由,权限验证,提炼了典型的业务模型,提供了丰富的功能组件,它可以帮助你快速搭建企业级中后台产品原型。相信不管你的需求是什么,本项目都能帮助到你。 -- [在线预览](http://panjiachen.github.io/vue-element-admin) +- [在线预览](https://panjiachen.github.io/vue-element-admin) - [使用文档](https://panjiachen.github.io/vue-element-admin-site/zh/) @@ -204,7 +204,7 @@ Detailed changes for each release are documented in the [release notes](https:// ## Online Demo -[在线 Demo](http://panjiachen.github.io/vue-element-admin) +[在线 Demo](https://panjiachen.github.io/vue-element-admin) ## Donate @@ -221,7 +221,7 @@ Detailed changes for each release are documented in the [release notes](https:// Modern browsers and Internet Explorer 10+. -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | +| [IE / Edge](https://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](https://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](https://godban.github.io/browsers-support-badges/)
Chrome | [Safari](https://godban.github.io/browsers-support-badges/)
Safari | | --------- | --------- | --------- | --------- | | IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions diff --git a/mock/mock-server.js b/mock/mock-server.js index af7e67ee..fcb931ad 100644 --- a/mock/mock-server.js +++ b/mock/mock-server.js @@ -29,7 +29,7 @@ module.exports = app => { require('@babel/register') // parse app.body - // http://expressjs.com/en/4x/api.html#req.body + // https://expressjs.com/en/4x/api.html#req.body app.use(bodyParser.json()) app.use(bodyParser.urlencoded({ extended: true diff --git a/src/views/components-demo/splitpane.vue b/src/views/components-demo/splitpane.vue index 72b62014..4259abea 100644 --- a/src/views/components-demo/splitpane.vue +++ b/src/views/components-demo/splitpane.vue @@ -1,7 +1,7 @@ diff --git a/src/views/errorPage/401.vue b/src/views/error-page/401.vue similarity index 100% rename from src/views/errorPage/401.vue rename to src/views/error-page/401.vue diff --git a/src/views/errorPage/404.vue b/src/views/error-page/404.vue similarity index 100% rename from src/views/errorPage/404.vue rename to src/views/error-page/404.vue diff --git a/src/views/example/components/ArticleDetail.vue b/src/views/example/components/ArticleDetail.vue index 2213e927..58574ab0 100644 --- a/src/views/example/components/ArticleDetail.vue +++ b/src/views/example/components/ArticleDetail.vue @@ -76,12 +76,12 @@ diff --git a/src/views/table/inlineEditTable.vue b/src/views/table/inline-edit-table.vue similarity index 100% rename from src/views/table/inlineEditTable.vue rename to src/views/table/inline-edit-table.vue From 14580da5b31384f407f8d7db6f687081816907a1 Mon Sep 17 00:00:00 2001 From: linfei Date: Mon, 15 Apr 2019 10:31:06 +0800 Subject: [PATCH 08/16] perf[Breadcrumb]: revise the breadcrumb navigation of permission and zip (#1908) --- src/router/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/router/index.js b/src/router/index.js index 393e8e88..d04a64be 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -118,8 +118,9 @@ export const asyncRoutes = [ { path: '/permission', component: Layout, - redirect: '/permission/index', + redirect: '/permission/page', alwaysShow: true, // will always show the root menu + name: 'Permission', meta: { title: 'permission', icon: 'lock', @@ -301,6 +302,7 @@ export const asyncRoutes = [ component: Layout, redirect: '/zip/download', alwaysShow: true, + name: 'Zip', meta: { title: 'zip', icon: 'zip' }, children: [ { From 26d0f40df21fa5e5583a20cb3df14ae9d475bb3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=9E=E7=A9=BA?= Date: Mon, 15 Apr 2019 11:58:43 +0800 Subject: [PATCH 09/16] feature: change page title when route change (#1910) --- src/components/ThemePicker/index.vue | 14 ++++++++++++-- src/permission.js | 4 ++++ src/settings.js | 6 ++---- src/store/modules/settings.js | 6 ++++-- src/utils/get-page-title.js | 13 +++++++++++++ vue.config.js | 4 ++-- 6 files changed, 37 insertions(+), 10 deletions(-) create mode 100644 src/utils/get-page-title.js diff --git a/src/components/ThemePicker/index.vue b/src/components/ThemePicker/index.vue index 0a556248..90c03311 100644 --- a/src/components/ThemePicker/index.vue +++ b/src/components/ThemePicker/index.vue @@ -11,16 +11,26 @@ const version = require('element-ui/package.json').version // element-ui version from node_modules const ORIGINAL_THEME = '#409EFF' // default color -import defaultSettings from '@/settings' export default { data() { return { chalk: '', // content of theme-chalk css - theme: defaultSettings.theme + theme: '' + } + }, + computed: { + defaultTheme() { + return this.$store.state.settings.theme } }, watch: { + defaultTheme: { + handler: function(val, oldVal) { + this.theme = val + }, + immediate: true + }, async theme(val) { const oldVal = this.chalk ? this.theme : ORIGINAL_THEME if (typeof val !== 'string') return diff --git a/src/permission.js b/src/permission.js index 7cc2a5cf..750aeab6 100644 --- a/src/permission.js +++ b/src/permission.js @@ -4,6 +4,7 @@ import { Message } from 'element-ui' import NProgress from 'nprogress' // progress bar import 'nprogress/nprogress.css' // progress bar style import { getToken } from '@/utils/auth' // get token from cookie +import getPageTitle from '@/utils/get-page-title' NProgress.configure({ showSpinner: false }) // NProgress Configuration @@ -13,6 +14,9 @@ router.beforeEach(async(to, from, next) => { // start progress bar NProgress.start() + // set page title + document.title = getPageTitle(to.meta.title) + // determine whether the user has logged in const hasToken = getToken() diff --git a/src/settings.js b/src/settings.js index e7ad4e1d..1ebc7f29 100644 --- a/src/settings.js +++ b/src/settings.js @@ -1,7 +1,5 @@ -import variables from '@/styles/element-variables.scss' - -export default { - theme: variables.theme, +module.exports = { + title: 'Vue Element Admin', /** * @type {boolean} true | false diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index 8522a5aa..e389af79 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -1,8 +1,10 @@ +import variables from '@/styles/element-variables.scss' import defaultSettings from '@/settings' -const { showSettings, tagsView, fixedHeader, sidebarLogo, theme } = defaultSettings + +const { showSettings, tagsView, fixedHeader, sidebarLogo } = defaultSettings const state = { - theme: theme, + theme: variables.theme, showSettings: showSettings, tagsView: tagsView, fixedHeader: fixedHeader, diff --git a/src/utils/get-page-title.js b/src/utils/get-page-title.js new file mode 100644 index 00000000..4b6604cd --- /dev/null +++ b/src/utils/get-page-title.js @@ -0,0 +1,13 @@ +import defaultSettings from '@/settings' +import i18n from '@/lang' + +const title = defaultSettings.title || 'Vue Element Admin' + +export default function getPageTitle(key) { + const hasKey = i18n.te(`route.${key}`) + if (hasKey) { + const pageName = i18n.t(`route.${key}`) + return `${pageName} - ${title}` + } + return `${title}` +} diff --git a/vue.config.js b/vue.config.js index cbd79510..0306b27c 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,12 +1,12 @@ 'use strict' const path = require('path') -const pkg = require('./package.json') +const defaultSettings = require('./src/settings.js') function resolve(dir) { return path.join(__dirname, dir) } -const name = pkg.name || 'vue-element-admin' // page title +const name = defaultSettings.title || 'vue Element Admin' // page title const port = 9527 // dev port // All configuration item explanations can be find in https://cli.vuejs.org/config/ From be7ec4c0ff8c462ab0e45e1bab640bd2e72767b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?= Date: Tue, 16 Apr 2019 11:20:13 +0800 Subject: [PATCH 10/16] docs: improve code comments (#1911) --- mock/article.js | 2 +- src/components/BackToTop/index.vue | 7 +--- src/components/JsonEditor/index.vue | 4 +-- src/components/Kanban/index.vue | 1 + src/components/ThemePicker/index.vue | 1 - .../Tinymce/components/EditorImage.vue | 10 +++--- src/components/Upload/SingleImage.vue | 1 - src/directive/el-table/adaptive.js | 1 - src/directive/el-table/index.js | 1 - src/directive/permission/permission.js | 1 - src/filters/index.js | 2 +- src/lang/en.js | 3 ++ src/lang/es.js | 3 ++ src/lang/zh.js | 3 ++ src/main.js | 18 ++++++---- src/router/modules/components.js | 2 +- src/router/modules/nested.js | 2 +- src/router/modules/table.js | 2 +- src/store/modules/permission.js | 4 +-- src/styles/element-ui.scss | 2 +- src/styles/index.scss | 28 +++++---------- src/styles/sidebar.scss | 6 ++-- src/styles/transition.scss | 8 ++--- src/styles/variables.scss | 4 +-- src/utils/error-log.js | 4 +-- src/utils/request.js | 36 ++++++++++--------- src/views/components-demo/avatar-upload.vue | 4 +-- src/views/components-demo/back-to-top.vue | 8 ++--- src/views/components-demo/count-to.vue | 8 ++--- src/views/components-demo/dnd-list.vue | 4 +-- src/views/components-demo/dropzone.vue | 4 +-- src/views/components-demo/json-editor.vue | 4 +-- src/views/components-demo/markdown.vue | 4 +-- src/views/components-demo/split-pane.vue | 4 +-- src/views/components-demo/sticky.vue | 2 +- src/views/components-demo/tinymce.vue | 4 +-- src/views/error-log/index.vue | 4 +-- .../example/components/ArticleDetail.vue | 20 +++++------ .../example/components/Dropdown/Comment.vue | 6 ++-- .../example/components/Dropdown/Platform.vue | 2 +- .../example/components/Dropdown/SourceUrl.vue | 6 ++-- src/views/example/components/Warning.vue | 9 +++-- src/views/guide/index.vue | 4 +-- src/views/pdf/index.vue | 2 +- src/views/permission/directive.vue | 4 +-- src/views/svg-icons/index.vue | 4 +-- src/views/table/complex-table.vue | 6 ++-- src/views/theme/index.vue | 2 +- vue.config.js | 1 + 49 files changed, 134 insertions(+), 138 deletions(-) diff --git a/mock/article.js b/mock/article.js index 45b75296..bc236eb9 100644 --- a/mock/article.js +++ b/mock/article.js @@ -3,7 +3,7 @@ import Mock from 'mockjs' const List = [] const count = 100 -const baseContent = '

我是测试数据我是测试数据

' +const baseContent = '

I am testing data, I am testing data.

' const image_uri = 'https://wpimg.wallstcn.com/e4558086-631c-425c-9430-56ffb46e70b3' for (let i = 0; i < count; i++) { diff --git a/src/components/BackToTop/index.vue b/src/components/BackToTop/index.vue index c094037f..36522f4a 100644 --- a/src/components/BackToTop/index.vue +++ b/src/components/BackToTop/index.vue @@ -1,12 +1,7 @@ diff --git a/src/components/JsonEditor/index.vue b/src/components/JsonEditor/index.vue index 81715f5d..07b282e4 100644 --- a/src/components/JsonEditor/index.vue +++ b/src/components/JsonEditor/index.vue @@ -25,8 +25,8 @@ export default { }, watch: { value(value) { - const editor_value = this.jsonEditor.getValue() - if (value !== editor_value) { + const editorValue = this.jsonEditor.getValue() + if (value !== editorValue) { this.jsonEditor.setValue(JSON.stringify(this.value, null, 2)) } } diff --git a/src/components/Kanban/index.vue b/src/components/Kanban/index.vue index c2cb4691..82f7dd7e 100644 --- a/src/components/Kanban/index.vue +++ b/src/components/Kanban/index.vue @@ -15,6 +15,7 @@ +