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..01034b51 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/) @@ -50,13 +50,13 @@ It is a magical vue admin based on the newest development stack of vue, built-in - Desktop: [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin) - Typescript: [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (Credits: [@Armour](https://github.com/Armour)) -**The current version is `4.0-beta`. If you find a problem, please put [issue](https://github.com/PanJiaChen/vue-element-admin/issues/new). If you want to use the old version - stable version, you can switch branch to [tag/3.11.0](https://github.com/PanJiaChen/vue-element-admin/tree/tag/3.11.0)** +**The current version is `v4.0+` build on `vue-cli`. If you find a problem, please put [issue](https://github.com/PanJiaChen/vue-element-admin/issues/new). If you want to use the old version , you can switch branch to [tag/3.11.0](https://github.com/PanJiaChen/vue-element-admin/tree/tag/3.11.0), it does not rely on `vue-cli'** **This project does not support low version browsers (e.g. IE). Please add polyfill by yourself.** ## 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..0e15d8a4 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/) @@ -50,7 +50,7 @@ - 桌面端: [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin) - Typescript 版: [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (鸣谢: [@Armour](https://github.com/Armour)) -**目前版本为 `4.0-beta`,若发现问题,欢迎提[issue](https://github.com/PanJiaChen/vue-element-admin/issues/new)。若你想使用旧版本-稳定版,可以切换分支到[tag/3.11.0](https://github.com/PanJiaChen/vue-element-admin/tree/tag/3.11.0)** +**目前版本为 `v4.0+` 基于 `vue-cli` 进行构建,若发现问题,欢迎提[issue](https://github.com/PanJiaChen/vue-element-admin/issues/new)。若你想使用旧版本,可以切换分支到[tag/3.11.0](https://github.com/PanJiaChen/vue-element-admin/tree/tag/3.11.0),它不依赖 `vue-cli`** **该项目不支持低版本浏览器(如 ie),有需求请自行添加 polyfill [详情](https://github.com/PanJiaChen/vue-element-admin/wiki#babel-polyfill)** @@ -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/index.js b/mock/index.js index 08cdc471..6907e861 100644 --- a/mock/index.js +++ b/mock/index.js @@ -4,7 +4,7 @@ import { param2Obj } from '../src/utils' import user from './user' import role from './role' import article from './article' -import search from './remoteSearch' +import search from './remote-search' const mocks = [ ...user, diff --git a/mock/mock-server.js b/mock/mock-server.js index 99346afb..b29b7c3f 100644 --- a/mock/mock-server.js +++ b/mock/mock-server.js @@ -3,12 +3,16 @@ const bodyParser = require('body-parser') const chalk = require('chalk') function registerRoutes(app) { + let mockLastIndex const { default: mocks } = require('./index.js') for (const mock of mocks) { app[mock.type](mock.url, mock.response) + mockLastIndex = app._router.stack.length } + const mockRoutesLength = Object.keys(mocks).length return { - mockRoutesLength: Object.keys(mocks).length + mockRoutesLength: mockRoutesLength, + mockStartIndex: mockLastIndex - mockRoutesLength } } @@ -20,40 +24,20 @@ function unregisterRoutes() { }) } -function getPath(path) { - var match = path.toString() - .replace('\\/?', '') - .replace('(?=\\/|$)', '$') - .match(/^\/\^((?:\\[.*+?^${}()|[\]\\\/]|[^.*+?^${}()|[\]\\\/])*)\$\//) - return match - ? match[1].replace(/\\(.)/g, '$1').split('/') - : path.toString() -} - -function getMockRoutesIndex(app) { - for (let index = 0; index <= app._router.stack.length; index++) { - const r = app._router.stack[index] - if (r.route && r.route.path) { - const path = getPath(r.route.path) - if (path.includes('mock')) { - return index - } - } - } -} - module.exports = app => { // es6 polyfill 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 })) - const { mockRoutesLength } = registerRoutes(app) + const mockRoutes = registerRoutes(app) + var mockRoutesLength = mockRoutes.mockRoutesLength + var mockStartIndex = mockRoutes.mockStartIndex // watch files, hot reload mock server chokidar.watch(('./mock'), { @@ -62,16 +46,15 @@ module.exports = app => { ignoreInitial: true }).on('all', (event, path) => { if (event === 'change' || event === 'add') { - // find mock routes stack index - const index = getMockRoutesIndex(app) - // remove mock routes stack - app._router.stack.splice(index, mockRoutesLength) + app._router.stack.splice(mockStartIndex, mockRoutesLength) // clear routes cache unregisterRoutes() - registerRoutes(app) + const mockRoutes = registerRoutes(app) + mockRoutesLength = mockRoutes.mockRoutesLength + mockStartIndex = mockRoutes.mockStartIndex console.log(chalk.magentaBright(`\n > Mock Server hot reload success! changed ${path}`)) } diff --git a/mock/remoteSearch.js b/mock/remote-search.js similarity index 100% rename from mock/remoteSearch.js rename to mock/remote-search.js diff --git a/mock/role/routes.js b/mock/role/routes.js index 14413d48..62a09d01 100644 --- a/mock/role/routes.js +++ b/mock/role/routes.js @@ -19,17 +19,17 @@ export const constantRoutes = [ }, { path: '/auth-redirect', - component: 'views/login/authRedirect', + component: 'views/login/auth-redirect', hidden: true }, { path: '/404', - component: 'views/errorPage/404', + component: 'views/error-page/404', hidden: true }, { path: '/401', - component: 'views/errorPage/401', + component: 'views/error-page/401', hidden: true }, { @@ -150,19 +150,19 @@ export const asyncRoutes = [ }, { path: 'json-editor', - component: 'views/components-demo/jsonEditor', + component: 'views/components-demo/json-editor', name: 'JsonEditorDemo', meta: { title: 'jsonEditor' } }, { - path: 'splitpane', - component: 'views/components-demo/splitpane', + path: 'split-pane', + component: 'views/components-demo/split-pane', name: 'SplitpaneDemo', meta: { title: 'splitPane' } }, { path: 'avatar-upload', - component: 'views/components-demo/avatarUpload', + component: 'views/components-demo/avatar-upload', name: 'AvatarUploadDemo', meta: { title: 'avatarUpload' } }, @@ -180,7 +180,7 @@ export const asyncRoutes = [ }, { path: 'count-to', - component: 'views/components-demo/countTo', + component: 'views/components-demo/count-to', name: 'CountToDemo', meta: { title: 'countTo' } }, @@ -192,31 +192,31 @@ export const asyncRoutes = [ }, { path: 'back-to-top', - component: 'views/components-demo/backToTop', + component: 'views/components-demo/back-to-top', name: 'BackToTopDemo', meta: { title: 'backToTop' } }, { path: 'drag-dialog', - component: 'views/components-demo/dragDialog', + component: 'views/components-demo/drag-dialog', name: 'DragDialogDemo', meta: { title: 'dragDialog' } }, { path: 'drag-select', - component: 'views/components-demo/dragSelect', + component: 'views/components-demo/drag-select', name: 'DragSelectDemo', meta: { title: 'dragSelect' } }, { path: 'dnd-list', - component: 'views/components-demo/dndList', + component: 'views/components-demo/dnd-list', name: 'DndListDemo', meta: { title: 'dndList' } }, { path: 'drag-kanban', - component: 'views/components-demo/dragKanban', + component: 'views/components-demo/drag-kanban', name: 'DragKanbanDemo', meta: { title: 'dragKanban' } } @@ -370,13 +370,13 @@ export const asyncRoutes = [ children: [ { path: '401', - component: 'views/errorPage/401', + component: 'views/error-page/401', name: 'Page401', meta: { title: 'page401', noCache: true } }, { path: '404', - component: 'views/errorPage/404', + component: 'views/error-page/404', name: 'Page404', meta: { title: 'page404', noCache: true } } @@ -390,7 +390,7 @@ export const asyncRoutes = [ children: [ { path: 'log', - component: 'views/errorLog/index', + component: 'views/error-log/index', name: 'ErrorLog', meta: { title: 'errorLog', icon: 'bug' } } @@ -409,25 +409,25 @@ export const asyncRoutes = [ children: [ { path: 'export-excel', - component: 'views/excel/exportExcel', + component: 'views/excel/export-excel', name: 'ExportExcel', meta: { title: 'exportExcel' } }, { path: 'export-selected-excel', - component: 'views/excel/selectExcel', + component: 'views/excel/select-excel', name: 'SelectExcel', meta: { title: 'selectExcel' } }, { path: 'export-merge-header', - component: 'views/excel/mergeHeader', + component: 'views/excel/merge-header', name: 'MergeHeader', meta: { title: 'mergeHeader' } }, { path: 'upload-excel', - component: 'views/excel/uploadExcel', + component: 'views/excel/upload-excel', name: 'UploadExcel', meta: { title: 'uploadExcel' } } 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", diff --git a/src/api/remoteSearch.js b/src/api/remote-search.js similarity index 100% rename from src/api/remoteSearch.js rename to src/api/remote-search.js diff --git a/src/components/Charts/Keyboard.vue b/src/components/Charts/Keyboard.vue new file mode 100644 index 00000000..0b258f36 --- /dev/null +++ b/src/components/Charts/Keyboard.vue @@ -0,0 +1,155 @@ + + + diff --git a/src/components/Charts/lineMarker.vue b/src/components/Charts/LineMarker.vue similarity index 100% rename from src/components/Charts/lineMarker.vue rename to src/components/Charts/LineMarker.vue diff --git a/src/components/Charts/mixChart.vue b/src/components/Charts/MixChart.vue similarity index 100% rename from src/components/Charts/mixChart.vue rename to src/components/Charts/MixChart.vue diff --git a/src/components/Charts/keyboard.vue b/src/components/Charts/keyboard.vue deleted file mode 100644 index 3f061bd0..00000000 --- a/src/components/Charts/keyboard.vue +++ /dev/null @@ -1,156 +0,0 @@ - - - diff --git a/src/components/Charts/mixins/resize.js b/src/components/Charts/mixins/resize.js index c4c432f4..dccaf1a8 100644 --- a/src/components/Charts/mixins/resize.js +++ b/src/components/Charts/mixins/resize.js @@ -3,7 +3,7 @@ import { debounce } from '@/utils' export default { data() { return { - sidebarElm: null + $_sidebarElm: null } }, mounted() { @@ -14,16 +14,18 @@ export default { }, 100) window.addEventListener('resize', this.__resizeHandler) - this.sidebarElm = document.getElementsByClassName('sidebar-container')[0] - this.sidebarElm && this.sidebarElm.addEventListener('transitionend', this.sidebarResizeHandler) + this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0] + this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler) }, beforeDestroy() { window.removeEventListener('resize', this.__resizeHandler) - this.sidebarElm && this.sidebarElm.removeEventListener('transitionend', this.sidebarResizeHandler) + this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler) }, methods: { - sidebarResizeHandler(e) { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_sidebarResizeHandler(e) { if (e.propertyName === 'width') { this.__resizeHandler() } diff --git a/src/components/DragSelect/index.vue b/src/components/DragSelect/index.vue index 4a2e6300..28256a8b 100644 --- a/src/components/DragSelect/index.vue +++ b/src/components/DragSelect/index.vue @@ -49,13 +49,13 @@ export default { diff --git a/src/components/MarkdownEditor/defaultOptions.js b/src/components/MarkdownEditor/default-options.js similarity index 100% rename from src/components/MarkdownEditor/defaultOptions.js rename to src/components/MarkdownEditor/default-options.js diff --git a/src/components/MarkdownEditor/index.vue b/src/components/MarkdownEditor/index.vue index 9ed7a584..3d6794b5 100644 --- a/src/components/MarkdownEditor/index.vue +++ b/src/components/MarkdownEditor/index.vue @@ -9,7 +9,7 @@ import 'tui-editor/dist/tui-editor.css' // editor ui import 'tui-editor/dist/tui-editor-contents.css' // editor content import Editor from 'tui-editor' -import defaultOptions from './defaultOptions' +import defaultOptions from './default-options' export default { name: 'MarddownEditor', diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue index a4962964..c815e132 100644 --- a/src/components/Pagination/index.vue +++ b/src/components/Pagination/index.vue @@ -15,7 +15,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/complexTable.vue b/src/views/table/complex-table.vue similarity index 100% rename from src/views/table/complexTable.vue rename to src/views/table/complex-table.vue diff --git a/src/views/table/dragTable.vue b/src/views/table/drag-table.vue similarity index 100% rename from src/views/table/dragTable.vue rename to src/views/table/drag-table.vue diff --git a/src/views/table/dynamicTable/fixedThead.vue b/src/views/table/dynamic-table/components/FixedThead.vue similarity index 100% rename from src/views/table/dynamicTable/fixedThead.vue rename to src/views/table/dynamic-table/components/FixedThead.vue diff --git a/src/views/table/dynamicTable/unfixedThead.vue b/src/views/table/dynamic-table/components/UnfixedThead.vue similarity index 100% rename from src/views/table/dynamicTable/unfixedThead.vue rename to src/views/table/dynamic-table/components/UnfixedThead.vue diff --git a/src/views/table/dynamicTable/index.vue b/src/views/table/dynamic-table/index.vue similarity index 70% rename from src/views/table/dynamicTable/index.vue rename to src/views/table/dynamic-table/index.vue index 4947b4b9..b1a6a6d5 100644 --- a/src/views/table/dynamicTable/index.vue +++ b/src/views/table/dynamic-table/index.vue @@ -13,12 +13,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