Compare commits
27 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
de3b29b5f3 | ||
|
54acf1e0d5 | ||
|
de08e49f19 | ||
|
2472107768 | ||
|
d18902dfee | ||
|
9ba2648689 | ||
|
1d0b26cec8 | ||
|
ea7e139696 | ||
|
deac95da1b | ||
|
2b51b987be | ||
|
45fef9b431 | ||
|
83e56488d8 | ||
|
f3bfaa0f2b | ||
|
e261fbcbfb | ||
|
471c297f13 | ||
|
093475ee50 | ||
|
cb3578e5c3 | ||
|
fe25c4d96b | ||
|
7fef8568c2 | ||
|
0dfa56c73e | ||
|
642d48e372 | ||
|
021c147b31 | ||
|
04d9b849dd | ||
|
2e74f0d782 | ||
|
dc162093cc | ||
|
8fd786c4ed | ||
|
54e7ce2b76 |
8
.babelrc
8
.babelrc
@@ -1,10 +1,12 @@
|
|||||||
{
|
{
|
||||||
"presets": [
|
"presets": [
|
||||||
["env", {
|
["env", {
|
||||||
"modules": false
|
"modules": false,
|
||||||
|
"targets": {
|
||||||
|
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
|
||||||
|
}
|
||||||
}],
|
}],
|
||||||
"stage-2"
|
"stage-2"
|
||||||
],
|
],
|
||||||
"plugins": ["transform-runtime"],
|
"plugins": ["transform-vue-jsx", "transform-runtime"]
|
||||||
"comments": false
|
|
||||||
}
|
}
|
||||||
|
337
.eslintrc.js
337
.eslintrc.js
@@ -1,144 +1,199 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
root: true,
|
root: true,
|
||||||
parser: 'babel-eslint',
|
parser: 'babel-eslint',
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
sourceType: 'module'
|
sourceType: 'module'
|
||||||
},
|
},
|
||||||
env: {
|
env: {
|
||||||
browser: true,
|
browser: true,
|
||||||
node: true,
|
node: true,
|
||||||
es6: true,
|
es6: true,
|
||||||
},
|
},
|
||||||
extends: 'eslint:recommended',
|
extends: 'eslint:recommended',
|
||||||
// required to lint *.vue files
|
// required to lint *.vue files
|
||||||
plugins: [
|
plugins: [
|
||||||
'html'
|
'html'
|
||||||
],
|
],
|
||||||
// check if imports actually resolve
|
// check if imports actually resolve
|
||||||
'settings': {
|
'settings': {
|
||||||
'import/resolver': {
|
'import/resolver': {
|
||||||
'webpack': {
|
'webpack': {
|
||||||
'config': 'build/webpack.base.conf.js'
|
'config': 'build/webpack.base.conf.js'
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
|
||||||
// add your custom rules here
|
|
||||||
//it is base on https://github.com/vuejs/eslint-config-vue
|
|
||||||
'rules': {
|
|
||||||
'accessor-pairs': 2,
|
|
||||||
'arrow-spacing': [2, { 'before': true, 'after': true }],
|
|
||||||
'block-spacing': [2, 'always'],
|
|
||||||
'brace-style': [2, '1tbs', { 'allowSingleLine': true }],
|
|
||||||
'camelcase': [0, { 'properties': 'always' }],
|
|
||||||
'comma-dangle': [2, 'never'],
|
|
||||||
'comma-spacing': [2, { 'before': false, 'after': true }],
|
|
||||||
'comma-style': [2, 'last'],
|
|
||||||
'constructor-super': 2,
|
|
||||||
'curly': [2, 'multi-line'],
|
|
||||||
'dot-location': [2, 'property'],
|
|
||||||
'eol-last': 2,
|
|
||||||
'eqeqeq': [2, 'allow-null'],
|
|
||||||
'generator-star-spacing': [2, { 'before': true, 'after': true }],
|
|
||||||
'handle-callback-err': [2, '^(err|error)$' ],
|
|
||||||
'indent': [2, 2, { 'SwitchCase': 1 }],
|
|
||||||
'jsx-quotes': [2, 'prefer-single'],
|
|
||||||
'key-spacing': [2, { 'beforeColon': false, 'afterColon': true }],
|
|
||||||
'keyword-spacing': [2, { 'before': true, 'after': true }],
|
|
||||||
'new-cap': [2, { 'newIsCap': true, 'capIsNew': false }],
|
|
||||||
'new-parens': 2,
|
|
||||||
'no-array-constructor': 2,
|
|
||||||
'no-caller': 2,
|
|
||||||
'no-console': 'off',
|
|
||||||
'no-class-assign': 2,
|
|
||||||
'no-cond-assign': 2,
|
|
||||||
'no-const-assign': 2,
|
|
||||||
'no-control-regex': 0,
|
|
||||||
'no-delete-var': 2,
|
|
||||||
'no-dupe-args': 2,
|
|
||||||
'no-dupe-class-members': 2,
|
|
||||||
'no-dupe-keys': 2,
|
|
||||||
'no-duplicate-case': 2,
|
|
||||||
'no-empty-character-class': 2,
|
|
||||||
'no-empty-pattern': 2,
|
|
||||||
'no-eval': 2,
|
|
||||||
'no-ex-assign': 2,
|
|
||||||
'no-extend-native': 2,
|
|
||||||
'no-extra-bind': 2,
|
|
||||||
'no-extra-boolean-cast': 2,
|
|
||||||
'no-extra-parens': [2, 'functions'],
|
|
||||||
'no-fallthrough': 2,
|
|
||||||
'no-floating-decimal': 2,
|
|
||||||
'no-func-assign': 2,
|
|
||||||
'no-implied-eval': 2,
|
|
||||||
'no-inner-declarations': [2, 'functions'],
|
|
||||||
'no-invalid-regexp': 2,
|
|
||||||
'no-irregular-whitespace': 2,
|
|
||||||
'no-iterator': 2,
|
|
||||||
'no-label-var': 2,
|
|
||||||
'no-labels': [2, { 'allowLoop': false, 'allowSwitch': false }],
|
|
||||||
'no-lone-blocks': 2,
|
|
||||||
'no-mixed-spaces-and-tabs': 2,
|
|
||||||
'no-multi-spaces': 2,
|
|
||||||
'no-multi-str': 2,
|
|
||||||
'no-multiple-empty-lines': [2, { 'max': 1 }],
|
|
||||||
'no-native-reassign': 2,
|
|
||||||
'no-negated-in-lhs': 2,
|
|
||||||
'no-new-object': 2,
|
|
||||||
'no-new-require': 2,
|
|
||||||
'no-new-symbol': 2,
|
|
||||||
'no-new-wrappers': 2,
|
|
||||||
'no-obj-calls': 2,
|
|
||||||
'no-octal': 2,
|
|
||||||
'no-octal-escape': 2,
|
|
||||||
'no-path-concat': 2,
|
|
||||||
'no-proto': 2,
|
|
||||||
'no-redeclare': 2,
|
|
||||||
'no-regex-spaces': 2,
|
|
||||||
'no-return-assign': [2, 'except-parens'],
|
|
||||||
'no-self-assign': 2,
|
|
||||||
'no-self-compare': 2,
|
|
||||||
'no-sequences': 2,
|
|
||||||
'no-shadow-restricted-names': 2,
|
|
||||||
'no-spaced-func': 2,
|
|
||||||
'no-sparse-arrays': 2,
|
|
||||||
'no-this-before-super': 2,
|
|
||||||
'no-throw-literal': 2,
|
|
||||||
'no-trailing-spaces': 2,
|
|
||||||
'no-undef': 2,
|
|
||||||
'no-undef-init': 2,
|
|
||||||
'no-unexpected-multiline': 2,
|
|
||||||
'no-unmodified-loop-condition': 2,
|
|
||||||
'no-unneeded-ternary': [2, { 'defaultAssignment': false }],
|
|
||||||
'no-unreachable': 2,
|
|
||||||
'no-unsafe-finally': 2,
|
|
||||||
'no-unused-vars': [2, { 'vars': 'all', 'args': 'none' }],
|
|
||||||
'no-useless-call': 2,
|
|
||||||
'no-useless-computed-key': 2,
|
|
||||||
'no-useless-constructor': 2,
|
|
||||||
'no-useless-escape': 0,
|
|
||||||
'no-whitespace-before-property': 2,
|
|
||||||
'no-with': 2,
|
|
||||||
'one-var': [2, { 'initialized': 'never' }],
|
|
||||||
'operator-linebreak': [2, 'after', { 'overrides': { '?': 'before', ':': 'before' } }],
|
|
||||||
'padded-blocks': [2, 'never'],
|
|
||||||
'quotes': [2, 'single', { 'avoidEscape': true, 'allowTemplateLiterals': true }],
|
|
||||||
'semi': [2, 'never'],
|
|
||||||
'semi-spacing': [2, { 'before': false, 'after': true }],
|
|
||||||
'space-before-blocks': [2, 'always'],
|
|
||||||
'space-before-function-paren': [2, 'never'],
|
|
||||||
'space-in-parens': [2, 'never'],
|
|
||||||
'space-infix-ops': 2,
|
|
||||||
'space-unary-ops': [2, { 'words': true, 'nonwords': false }],
|
|
||||||
'spaced-comment': [2, 'always', { 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','] }],
|
|
||||||
'template-curly-spacing': [2, 'never'],
|
|
||||||
'use-isnan': 2,
|
|
||||||
'valid-typeof': 2,
|
|
||||||
'wrap-iife': [2, 'any'],
|
|
||||||
'yield-star-spacing': [2, 'both'],
|
|
||||||
'yoda': [2, 'never'],
|
|
||||||
'prefer-const': 2,
|
|
||||||
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
|
|
||||||
'object-curly-spacing': [2, 'always', { objectsInObjects: false }],
|
|
||||||
'array-bracket-spacing': [2, 'never']
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
// add your custom rules here
|
||||||
|
//it is base on https://github.com/vuejs/eslint-config-vue
|
||||||
|
'rules': {
|
||||||
|
'accessor-pairs': 2,
|
||||||
|
'arrow-spacing': [2, {
|
||||||
|
'before': true,
|
||||||
|
'after': true
|
||||||
|
}],
|
||||||
|
'block-spacing': [2, 'always'],
|
||||||
|
'brace-style': [2, '1tbs', {
|
||||||
|
'allowSingleLine': true
|
||||||
|
}],
|
||||||
|
'camelcase': [0, {
|
||||||
|
'properties': 'always'
|
||||||
|
}],
|
||||||
|
'comma-dangle': [2, 'never'],
|
||||||
|
'comma-spacing': [2, {
|
||||||
|
'before': false,
|
||||||
|
'after': true
|
||||||
|
}],
|
||||||
|
'comma-style': [2, 'last'],
|
||||||
|
'constructor-super': 2,
|
||||||
|
'curly': [2, 'multi-line'],
|
||||||
|
'dot-location': [2, 'property'],
|
||||||
|
'eol-last': 2,
|
||||||
|
'eqeqeq': [2, 'allow-null'],
|
||||||
|
'generator-star-spacing': [2, {
|
||||||
|
'before': true,
|
||||||
|
'after': true
|
||||||
|
}],
|
||||||
|
'handle-callback-err': [2, '^(err|error)$'],
|
||||||
|
'indent': [2, 2, {
|
||||||
|
'SwitchCase': 1
|
||||||
|
}],
|
||||||
|
'jsx-quotes': [2, 'prefer-single'],
|
||||||
|
'key-spacing': [2, {
|
||||||
|
'beforeColon': false,
|
||||||
|
'afterColon': true
|
||||||
|
}],
|
||||||
|
'keyword-spacing': [2, {
|
||||||
|
'before': true,
|
||||||
|
'after': true
|
||||||
|
}],
|
||||||
|
'new-cap': [2, {
|
||||||
|
'newIsCap': true,
|
||||||
|
'capIsNew': false
|
||||||
|
}],
|
||||||
|
'new-parens': 2,
|
||||||
|
'no-array-constructor': 2,
|
||||||
|
'no-caller': 2,
|
||||||
|
'no-console': 'off',
|
||||||
|
'no-class-assign': 2,
|
||||||
|
'no-cond-assign': 2,
|
||||||
|
'no-const-assign': 2,
|
||||||
|
'no-control-regex': 0,
|
||||||
|
'no-delete-var': 2,
|
||||||
|
'no-dupe-args': 2,
|
||||||
|
'no-dupe-class-members': 2,
|
||||||
|
'no-dupe-keys': 2,
|
||||||
|
'no-duplicate-case': 2,
|
||||||
|
'no-empty-character-class': 2,
|
||||||
|
'no-empty-pattern': 2,
|
||||||
|
'no-eval': 2,
|
||||||
|
'no-ex-assign': 2,
|
||||||
|
'no-extend-native': 2,
|
||||||
|
'no-extra-bind': 2,
|
||||||
|
'no-extra-boolean-cast': 2,
|
||||||
|
'no-extra-parens': [2, 'functions'],
|
||||||
|
'no-fallthrough': 2,
|
||||||
|
'no-floating-decimal': 2,
|
||||||
|
'no-func-assign': 2,
|
||||||
|
'no-implied-eval': 2,
|
||||||
|
'no-inner-declarations': [2, 'functions'],
|
||||||
|
'no-invalid-regexp': 2,
|
||||||
|
'no-irregular-whitespace': 2,
|
||||||
|
'no-iterator': 2,
|
||||||
|
'no-label-var': 2,
|
||||||
|
'no-labels': [2, {
|
||||||
|
'allowLoop': false,
|
||||||
|
'allowSwitch': false
|
||||||
|
}],
|
||||||
|
'no-lone-blocks': 2,
|
||||||
|
'no-mixed-spaces-and-tabs': 2,
|
||||||
|
'no-multi-spaces': 2,
|
||||||
|
'no-multi-str': 2,
|
||||||
|
'no-multiple-empty-lines': [2, {
|
||||||
|
'max': 1
|
||||||
|
}],
|
||||||
|
'no-native-reassign': 2,
|
||||||
|
'no-negated-in-lhs': 2,
|
||||||
|
'no-new-object': 2,
|
||||||
|
'no-new-require': 2,
|
||||||
|
'no-new-symbol': 2,
|
||||||
|
'no-new-wrappers': 2,
|
||||||
|
'no-obj-calls': 2,
|
||||||
|
'no-octal': 2,
|
||||||
|
'no-octal-escape': 2,
|
||||||
|
'no-path-concat': 2,
|
||||||
|
'no-proto': 2,
|
||||||
|
'no-redeclare': 2,
|
||||||
|
'no-regex-spaces': 2,
|
||||||
|
'no-return-assign': [2, 'except-parens'],
|
||||||
|
'no-self-assign': 2,
|
||||||
|
'no-self-compare': 2,
|
||||||
|
'no-sequences': 2,
|
||||||
|
'no-shadow-restricted-names': 2,
|
||||||
|
'no-spaced-func': 2,
|
||||||
|
'no-sparse-arrays': 2,
|
||||||
|
'no-this-before-super': 2,
|
||||||
|
'no-throw-literal': 2,
|
||||||
|
'no-trailing-spaces': 2,
|
||||||
|
'no-undef': 2,
|
||||||
|
'no-undef-init': 2,
|
||||||
|
'no-unexpected-multiline': 2,
|
||||||
|
'no-unmodified-loop-condition': 2,
|
||||||
|
'no-unneeded-ternary': [2, {
|
||||||
|
'defaultAssignment': false
|
||||||
|
}],
|
||||||
|
'no-unreachable': 2,
|
||||||
|
'no-unsafe-finally': 2,
|
||||||
|
'no-unused-vars': [2, {
|
||||||
|
'vars': 'all',
|
||||||
|
'args': 'none'
|
||||||
|
}],
|
||||||
|
'no-useless-call': 2,
|
||||||
|
'no-useless-computed-key': 2,
|
||||||
|
'no-useless-constructor': 2,
|
||||||
|
'no-useless-escape': 0,
|
||||||
|
'no-whitespace-before-property': 2,
|
||||||
|
'no-with': 2,
|
||||||
|
'one-var': [2, {
|
||||||
|
'initialized': 'never'
|
||||||
|
}],
|
||||||
|
'operator-linebreak': [2, 'after', {
|
||||||
|
'overrides': {
|
||||||
|
'?': 'before',
|
||||||
|
':': 'before'
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
'padded-blocks': [2, 'never'],
|
||||||
|
'quotes': [2, 'single', {
|
||||||
|
'avoidEscape': true,
|
||||||
|
'allowTemplateLiterals': true
|
||||||
|
}],
|
||||||
|
'semi': [2, 'never'],
|
||||||
|
'semi-spacing': [2, {
|
||||||
|
'before': false,
|
||||||
|
'after': true
|
||||||
|
}],
|
||||||
|
'space-before-blocks': [2, 'always'],
|
||||||
|
'space-before-function-paren': [2, 'never'],
|
||||||
|
'space-in-parens': [2, 'never'],
|
||||||
|
'space-infix-ops': 2,
|
||||||
|
'space-unary-ops': [2, {
|
||||||
|
'words': true,
|
||||||
|
'nonwords': false
|
||||||
|
}],
|
||||||
|
'spaced-comment': [2, 'always', {
|
||||||
|
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
|
||||||
|
}],
|
||||||
|
'template-curly-spacing': [2, 'never'],
|
||||||
|
'use-isnan': 2,
|
||||||
|
'valid-typeof': 2,
|
||||||
|
'wrap-iife': [2, 'any'],
|
||||||
|
'yield-star-spacing': [2, 'both'],
|
||||||
|
'yoda': [2, 'never'],
|
||||||
|
'prefer-const': 2,
|
||||||
|
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
|
||||||
|
'object-curly-spacing': [2, 'always', {
|
||||||
|
objectsInObjects: false
|
||||||
|
}],
|
||||||
|
'array-bracket-spacing': [2, 'never']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
13
.gitignore
vendored
13
.gitignore
vendored
@@ -2,9 +2,20 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
dist/
|
dist/
|
||||||
gifs/
|
gifs/
|
||||||
npm-debug.log
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
|
||||||
test/unit/coverage
|
test/unit/coverage
|
||||||
test/e2e/reports
|
test/e2e/reports
|
||||||
selenium-debug.log
|
selenium-debug.log
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
.idea
|
.idea
|
||||||
|
.vscode
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"plugins": {
|
"plugins": {
|
||||||
|
"postcss-import": {},
|
||||||
|
"postcss-url": {},
|
||||||
// to edit target browsers: use "browserslist" field in package.json
|
// to edit target browsers: use "browserslist" field in package.json
|
||||||
"autoprefixer": {}
|
"autoprefixer": {}
|
||||||
}
|
}
|
||||||
|
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2017 PanJiaChen
|
Copyright (c) 2017-present PanJiaChen
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
177
README-en.md
177
README-en.md
@@ -1,177 +0,0 @@
|
|||||||
[](https://github.com/vuejs/vue)
|
|
||||||
[](https://github.com/ElemeFE/element)
|
|
||||||
[](https://github.com/PanJiaChen/vue-element-admin/blob/master/LICENSE)
|
|
||||||
[]()
|
|
||||||
|
|
||||||
## Intro
|
|
||||||
|
|
||||||
> In the past half year, I have been building a backend for management dashboard using Vue. Though the backend has contained greater than 70 pages and over 10 permissions, it still takes insignificant effort to maintain the project. So I decide to make it open source so as to share my development experience and progress on backend. The tech stack is mainly [Vue.js](https://github.com/vuejs/vue)+[Element](https://github.com/ElemeFE/element)+[axios](https://github.com/mzabriskie/axios). Since it's a personal project, all data requests are simulated with [Mock.js](https://github.com/nuysoft/Mock). **Note:** if anyone wants to modify or develop based on this project, please remove the mock files.
|
|
||||||
|
|
||||||
**Live demo:** http://panjiachen.github.io/vue-element-admin
|
|
||||||
|
|
||||||
**Note: element-ui@1.4.2 is used in the project, so vue 2.3.0+ is required.**
|
|
||||||
|
|
||||||
- vueAdmin-template: [vueAdmin-template](https://github.com/PanJiaChen/vueAdmin-template)
|
|
||||||
- electron-vue-admin: [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
|
|
||||||
- Donate:[donate](https://github.com/PanJiaChen/vue-element-admin/blob/master/README-en.md#donate)
|
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
- Login/Logout
|
|
||||||
- Permission authentication
|
|
||||||
- Sidebar
|
|
||||||
- Breadcrumb
|
|
||||||
- Rich text editor
|
|
||||||
- Markdown editor
|
|
||||||
- JSON editor
|
|
||||||
- Drag & drop list
|
|
||||||
- SplitPane
|
|
||||||
- Dropzone
|
|
||||||
- Sticky
|
|
||||||
- CountTo
|
|
||||||
- ECharts
|
|
||||||
- 401, 404 error page
|
|
||||||
- Error log
|
|
||||||
- Export Excel
|
|
||||||
- Upload Excel
|
|
||||||
- Export Zip
|
|
||||||
- Table example
|
|
||||||
- Interactive table example
|
|
||||||
- Drag & drop table example
|
|
||||||
- Form example
|
|
||||||
- Multi-environments distribution
|
|
||||||
- Dashboard
|
|
||||||
- Two-factor authentication
|
|
||||||
- Collapsing sidebar (support nested routes)
|
|
||||||
- Mock data
|
|
||||||
- cache tabs example
|
|
||||||
- screenfull
|
|
||||||
- markdown2html
|
|
||||||
- views-tab
|
|
||||||
- clipboard
|
|
||||||
|
|
||||||
## Development
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Clone project
|
|
||||||
git clone https://github.com/PanJiaChen/vue-element-admin.git
|
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
npm install
|
|
||||||
|
|
||||||
# Or (not recommended for cnpm due to unknown bugs, use taobao mirror instead)
|
|
||||||
npm install --registry=https://registry.npm.taobao.org
|
|
||||||
|
|
||||||
# Run local dev server
|
|
||||||
npm run dev
|
|
||||||
```
|
|
||||||
|
|
||||||
Visit in browser: http://localhost:9527
|
|
||||||
|
|
||||||
## Distribution
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Build staged environment with webpack-bundle-analyzer
|
|
||||||
npm run build:sit-preview
|
|
||||||
|
|
||||||
# Build production environment
|
|
||||||
npm run build:prod
|
|
||||||
```
|
|
||||||
|
|
||||||
## Directory structure
|
|
||||||
|
|
||||||
```
|
|
||||||
├── build // build
|
|
||||||
├── config // config
|
|
||||||
├── src // source code
|
|
||||||
│ ├── api // all requests
|
|
||||||
│ ├── assets // static resource like themes, fonts
|
|
||||||
│ ├── components // global public components
|
|
||||||
│ ├── directive // global directive
|
|
||||||
│ ├── filters // global filters
|
|
||||||
│ ├── mock // mock data
|
|
||||||
│ ├── router // router
|
|
||||||
│ ├── store // global status management
|
|
||||||
│ ├── styles // global styles
|
|
||||||
│ ├── utils // global public functions
|
|
||||||
│ ├── view // view
|
|
||||||
│ ├── App.vue // entry view
|
|
||||||
│ └── main.js // entry for loading components, initialization
|
|
||||||
├── static // third-party libraries not packed with Webpack
|
|
||||||
│ └── Tinymce // rich text
|
|
||||||
├── .babelrc // babel-loader config
|
|
||||||
├── eslintrc.js // eslint config
|
|
||||||
├── .gitignore // gitignore
|
|
||||||
├── favicon.ico // favicon
|
|
||||||
├── index.html // html template
|
|
||||||
└── package.json // package.json
|
|
||||||
```
|
|
||||||
|
|
||||||
## Changelog
|
|
||||||
Detailed changes for each release are documented in the [release notes](https://github.com/PanJiaChen/vue-element-admin/releases).
|
|
||||||
|
|
||||||
## Donate
|
|
||||||
If you find this project useful, you can buy me a cup of coffee
|
|
||||||

|
|
||||||
|
|
||||||
## State Management
|
|
||||||
|
|
||||||
Only status of user and app configuration is managed by Vuex. Other data are managed by their own business pages.
|
|
||||||
|
|
||||||
## Demo
|
|
||||||
|
|
||||||
#### Two-factor authentication, supporting WeChat and QQ
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Realtime switching themes
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### tabs
|
|
||||||
|
|
||||||
<br />
|
|
||||||
|
|
||||||
#### Collapsing sidebar
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Drag & drop table
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Interactive table
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Uploading cropped avatar
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Error log
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Rich text (integrated with Qiniu, watermark and customization)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Packaging table component
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Charts
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Exporting to Excel
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### More
|
|
||||||
|
|
||||||
http://panjiachen.github.io/vue-element-admin
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT
|
|
214
README.md
214
README.md
@@ -2,165 +2,151 @@
|
|||||||
<img width="320" src="https://wpimg.wallstcn.com/ecc53a42-d79b-42e2-8852-5126b810a4c8.svg">
|
<img width="320" src="https://wpimg.wallstcn.com/ecc53a42-d79b-42e2-8852-5126b810a4c8.svg">
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
# vue-element-admin
|
<p align="center">
|
||||||
|
<a href="https://github.com/vuejs/vue">
|
||||||
|
<img src="https://img.shields.io/badge/vue-2.5.10-brightgreen.svg" alt="vue">
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/ElemeFE/element">
|
||||||
|
<img src="https://img.shields.io/badge/element--ui-2.0.8-brightgreen.svg" alt="element-ui">
|
||||||
|
</a>
|
||||||
|
<a href="https://travis-ci.org/PanJiaChen/vue-element-admin" rel="nofollow">
|
||||||
|
<img src="https://travis-ci.org/PanJiaChen/vue-element-admin.svg?branch=master" alt="Build Status">
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/PanJiaChen/vue-element-admin/blob/master/LICENSE">
|
||||||
|
<img src="https://img.shields.io/github/license/mashape/apistatus.svg" alt="license">
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/PanJiaChen/vue-element-admin/releases">
|
||||||
|
<img src="https://img.shields.io/github/release/PanJiaChen/vue-element-admin.svg" alt="GitHub release">
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
[](https://github.com/vuejs/vue)
|
English | [简体中文](./README.zh-CN.md)
|
||||||
[](https://github.com/ElemeFE/element)
|
|
||||||
[](https://travis-ci.org/PanJiaChen/vue-element-admin)
|
|
||||||
[](https://github.com/PanJiaChen/vue-element-admin/blob/master/LICENSE)
|
|
||||||
[]()
|
|
||||||
|
|
||||||
**A magical vue admin.**
|
## Introduction
|
||||||
|
|
||||||
- [线上地址](http://panjiachen.github.io/vue-element-admin)
|
`vue-element-admin` is a production-ready solution for admin interfaces. Based on [Vue.js](https://github.com/vuejs/vue) and use the UI Toolkit -- [element](https://github.com/ElemeFE/element). `vue-element-admin` is a magical vue admin, it 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.
|
||||||
|
|
||||||
- [使用文档](https://panjiachen.github.io/vue-element-admin-site/#/)
|
- [Preview](http://panjiachen.github.io/vue-element-admin)
|
||||||
|
|
||||||
- [English Document](https://github.com/PanJiaChen/vue-element-admin/blob/master/README-en.md)
|
- [Documentation](https://panjiachen.github.io/vue-element-admin-site/#/)
|
||||||
|
|
||||||
- [wiki](https://github.com/PanJiaChen/vue-element-admin/wiki)
|
- [wiki](https://github.com/PanJiaChen/vue-element-admin/wiki)
|
||||||
|
|
||||||
- [donate](https://panjiachen.github.io/vue-element-admin-site/#/donate)
|
- [donate](https://panjiachen.github.io/vue-element-admin-site/#/donate)
|
||||||
|
|
||||||
**本项目的定位是后台集成方案,不适合当基础模板来开发。**
|
**vue-element-admin is a admin interfaces integration solution, which is not suitable for secondary development as a base template.**
|
||||||
- 模板建议使用: [vueAdmin-template](https://github.com/PanJiaChen/vueAdmin-template)
|
|
||||||
- 桌面端: [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
|
|
||||||
|
|
||||||
|
- Base template recommends using: [vueAdmin-template](https://github.com/PanJiaChen/vueAdmin-template)
|
||||||
|
- Desktop: [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
|
||||||
|
|
||||||
**注意:该项目目前使用element-ui@2.0.5版本,所以最低兼容 Vue 2.5.0**
|
**Note: This project uses element-ui@2.0.0+ version, so the minimum compatible vue@2.5.0**
|
||||||
|
|
||||||
楼主这里有一份调查[问卷](https://www.wjx.cn/m/16866569.aspx) 有空请填写一下,以表对本项目的支持~ps:不是给这个调查问卷网站做广告,所以填完问卷不用点上面抽奖有的没的那些东西
|
## 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/) 和 [element-ui](https://github.com/ElemeFE/element). All data requests for this project are simulated using [Mock.js](https://github.com/nuysoft/Mock). It would be helpful if you have pre-existing knowledge on those.
|
||||||
|
|
||||||
你的本地环境需要安装 [node](http://nodejs.org/) 和 [git](https://git-scm.com/)。我们的技术栈基于 [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/) 和 [element-ui](https://github.com/ElemeFE/element),提前了解和学习这些知识会对使用本项目有很大的帮助。
|
**This project is not a scaffolding and is more of an integrated solution.**
|
||||||
|
|
||||||
同时配套一个系列的教程文章,如何从零构建后一个完整的后台项目,建议大家先看完这些文章再来实践本项目
|
**This project does not support low version browsers (e.g. IE). Please add polyfill yourself if you need them.**
|
||||||
- [手摸手,带你用 vue 撸后台 系列一(基础篇)](https://juejin.im/post/59097cd7a22b9d0065fb61d2)
|
|
||||||
- [手摸手,带你用 vue 撸后台 系列二(登录权限篇)](https://juejin.im/post/591aa14f570c35006961acac)
|
|
||||||
- [手摸手,带你用 vue 撸后台 系列三 (实战篇)](https://juejin.im/post/593121aa0ce4630057f70d35)
|
|
||||||
- [手摸手,带你用 vue 撸后台 系列四(vueAdmin 一个极简的后台基础模板)](https://juejin.im/post/595b4d776fb9a06bbe7dba56)
|
|
||||||
- [手摸手,带你封装一个 vue component](https://segmentfault.com/a/1190000009090836)
|
|
||||||
- [手摸手,带你优雅的使用 icon](https://juejin.im/post/59bb864b5188257e7a427c09)
|
|
||||||
|
|
||||||
相应需求,开了一个qq群 `591724180` 方便大家交流
|
<p align="center">
|
||||||
|
<img width="900" src="https://wpimg.wallstcn.com/a5894c1b-f6af-456e-82df-1151da0839bf.png">
|
||||||
|
</p>
|
||||||
|
|
||||||
或者可以加入该 **[圈子](https://jianshiapp.com/circles/1209)** 讨论问题
|
## Features
|
||||||
|
```
|
||||||
**如有问题请先看上述使用文档和文章,若不能满足,欢迎 issue 和 pr**
|
- Login / Logout
|
||||||
|
- Permission authentication
|
||||||
**本项目并不是一个脚手架,更倾向于是一个集成解决方案**
|
- Multi-environment build
|
||||||
|
- Dynamic sidebar (supports multi-level routing)
|
||||||
**该项目不支持低版本游览器(如ie),有需求请自行添加polyfill [详情](https://github.com/PanJiaChen/vue-element-admin/wiki#babel-polyfill)**
|
- Dynamic breadcrumb
|
||||||
|
- I18n
|
||||||
|
- Customizable theme
|
||||||
## 功能
|
- Tags-view(Tab page Support right-click operation)
|
||||||
- 登录/注销
|
- Rich text editor
|
||||||
- 权限验证
|
- Markdown editor
|
||||||
- 多环境发布
|
- JSON editor
|
||||||
- 动态侧边栏(支持多级路由)
|
- Screenfull
|
||||||
- 动态面包屑
|
- Drag and drop list
|
||||||
- 国际化多语言
|
- Svg Sprite
|
||||||
- 多种动态换肤
|
|
||||||
- 快捷导航(标签页 支持右键操作)
|
|
||||||
- 富文本编辑器
|
|
||||||
- Markdown编辑器
|
|
||||||
- JSON编辑器
|
|
||||||
- Screenfull全屏
|
|
||||||
- 列表拖拽
|
|
||||||
- Svg Sprite 图标
|
|
||||||
- Dashboard
|
- Dashboard
|
||||||
- 本地mock数据
|
- Mock data
|
||||||
- Echarts 图表
|
- Echarts
|
||||||
- Clipboard(剪贴复制)
|
- Clipboard
|
||||||
- 401/404错误页面
|
- 401/404 error page
|
||||||
- 错误日志
|
- Error log
|
||||||
- 导出excel
|
- Export excel
|
||||||
- 导出zip
|
- Export zip
|
||||||
- 前端可视化excel
|
- Front-end visualization excel
|
||||||
- Table example
|
- Table example
|
||||||
- 动态table example
|
- Dynamictable example
|
||||||
- 拖拽table example
|
- Drag and drop table example
|
||||||
- 内联编辑table example
|
- Inline edit table example
|
||||||
- Form example
|
- Form example
|
||||||
- 二步登录
|
- Two-step login
|
||||||
- SplitPane
|
- SplitPane
|
||||||
- Dropzone
|
- Dropzone
|
||||||
- Sticky
|
- Sticky
|
||||||
- CountTo
|
- CountTo
|
||||||
- Markdown2html
|
- Markdown to html
|
||||||
|
```
|
||||||
|
|
||||||
|
## Getting started
|
||||||
|
|
||||||
## 开发
|
|
||||||
```bash
|
```bash
|
||||||
# 克隆项目
|
# clone the projice
|
||||||
git clone https://github.com/PanJiaChen/vue-element-admin.git
|
git clone https://github.com/PanJiaChen/vue-element-admin.git
|
||||||
|
|
||||||
# 安装依赖
|
# install dependency
|
||||||
npm install
|
npm install
|
||||||
|
|
||||||
//or # 建议不要用cnpm 安装有各种诡异的bug 可以通过如下操作解决npm速度慢的问题
|
|
||||||
npm install --registry=https://registry.npm.taobao.org
|
|
||||||
|
|
||||||
# 本地开发 开启服务
|
# develop
|
||||||
npm run dev
|
npm run dev
|
||||||
```
|
```
|
||||||
浏览器访问 http://localhost:9527
|
|
||||||
|
|
||||||
## 发布
|
This will automatically open http://localhost:9527.
|
||||||
|
|
||||||
|
## Build
|
||||||
```bash
|
```bash
|
||||||
# 发布测试环境 带webpack ananalyzer
|
# build for test environment
|
||||||
npm run build:sit-preview
|
npm run build:sit
|
||||||
|
|
||||||
# 构建生成环境
|
# build for production environment
|
||||||
npm run build:prod
|
npm run build:prod
|
||||||
```
|
```
|
||||||
|
|
||||||
更多信息请参考 [使用文档](https://panjiachen.github.io/vue-element-admin-site/#/)
|
## Advanced
|
||||||
|
```bash
|
||||||
|
# --report to build with bundle size analytics
|
||||||
|
npm run build:prod --report
|
||||||
|
|
||||||
## 目录结构
|
# --preview to start a server in local to preview
|
||||||
```shell
|
npm run build:prod --preview
|
||||||
├── build // 构建相关
|
|
||||||
├── config // 配置相关
|
|
||||||
├── src // 源代码
|
|
||||||
│ ├── api // 所有请求
|
|
||||||
│ ├── assets // 主题 字体等静态资源
|
|
||||||
│ ├── components // 全局公用组件
|
|
||||||
│ ├── directive // 全局指令
|
|
||||||
│ ├── filtres // 全局 filter
|
|
||||||
│ ├── icons // 项目所有 svg icons
|
|
||||||
│ ├── lang // 国际化 language
|
|
||||||
│ ├── mock // 项目mock 模拟数据
|
|
||||||
│ ├── router // 路由
|
|
||||||
│ ├── store // 全局 store管理
|
|
||||||
│ ├── styles // 全局样式
|
|
||||||
│ ├── utils // 全局公用方法
|
|
||||||
│ ├── vendor // 公用vendor
|
|
||||||
│ ├── views // view
|
|
||||||
│ ├── App.vue // 入口页面
|
|
||||||
│ ├── main.js // 入口 加载组件 初始化等
|
|
||||||
│ └── permission.js // 权限管理
|
|
||||||
├── static // 第三方不打包资源
|
|
||||||
│ └── Tinymce // 富文本
|
|
||||||
├── .babelrc // babel-loader 配置
|
|
||||||
├── eslintrc.js // eslint 配置项
|
|
||||||
├── .gitignore // git 忽略项
|
|
||||||
├── favicon.ico // favicon图标
|
|
||||||
├── index.html // html模板
|
|
||||||
└── package.json // package.json
|
|
||||||
|
|
||||||
|
# lint code
|
||||||
|
npm run lint
|
||||||
|
|
||||||
|
# auto fix
|
||||||
|
npm run lint -- --fix
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Refer to [Documentation](https://panjiachen.github.io/vue-element-admin-site/#/deploy) for more information
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
Detailed changes for each release are documented in the [release notes](https://github.com/PanJiaChen/vue-element-admin/releases).
|
Detailed changes for each release are documented in the [release notes](https://github.com/PanJiaChen/vue-element-admin/releases).
|
||||||
|
|
||||||
## [查看更多demo](http://panjiachen.github.io/vue-element-admin)
|
## Online Demo
|
||||||

|
[Preview](http://panjiachen.github.io/vue-element-admin)
|
||||||
|
|
||||||
## Donate
|
## Donate
|
||||||
If you find this project useful, you can buy me a cup of coffee
|
If you find this project useful, you can buy author a glass of juice :tropical_drink:
|
||||||

|
|
||||||
|

|
||||||
|
|
||||||
|
[Paypal Me](https://www.paypal.me/panfree23)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
MIT
|
[MIT](https://github.com/PanJiaChen/vue-element-admin/blob/master/LICENSE)
|
||||||
|
|
||||||
|
Copyright (c) 2017-present PanJiaChen
|
||||||
|
165
README.zh-CN.md
Normal file
165
README.zh-CN.md
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
<p align="center">
|
||||||
|
<img width="320" src="https://wpimg.wallstcn.com/ecc53a42-d79b-42e2-8852-5126b810a4c8.svg">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://github.com/vuejs/vue">
|
||||||
|
<img src="https://img.shields.io/badge/vue-2.5.10-brightgreen.svg" alt="vue">
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/ElemeFE/element">
|
||||||
|
<img src="https://img.shields.io/badge/element--ui-2.0.8-brightgreen.svg" alt="element-ui">
|
||||||
|
</a>
|
||||||
|
<a href="https://travis-ci.org/PanJiaChen/vue-element-admin" rel="nofollow">
|
||||||
|
<img src="https://travis-ci.org/PanJiaChen/vue-element-admin.svg?branch=master" alt="Build Status">
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/PanJiaChen/vue-element-admin/blob/master/LICENSE">
|
||||||
|
<img src="https://img.shields.io/github/license/mashape/apistatus.svg" alt="license">
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/PanJiaChen/vue-element-admin/releases">
|
||||||
|
<img src="https://img.shields.io/github/release/PanJiaChen/vue-element-admin.svg" alt="GitHub release">
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
简体中文 | [English](./README.md)
|
||||||
|
|
||||||
|
## 简介
|
||||||
|
|
||||||
|
`vue-element-admin` 是一个后台集成解决方案,它基于 [Vue.js](https://github.com/vuejs/vue) 和 [element](https://github.com/ElemeFE/element)。它使用了最新的前端技术栈,内置了i18国际化解决方案,动态路由,权限验证等很多功能特性,相信不管你的需求是什么,本项目都能帮助到你。
|
||||||
|
|
||||||
|
- [在线访问](http://panjiachen.github.io/vue-element-admin)
|
||||||
|
|
||||||
|
- [使用文档](https://panjiachen.github.io/vue-element-admin-site/#/)
|
||||||
|
|
||||||
|
- [wiki](https://github.com/PanJiaChen/vue-element-admin/wiki)
|
||||||
|
|
||||||
|
- [donate](https://panjiachen.github.io/vue-element-admin-site/#/donate)
|
||||||
|
|
||||||
|
**本项目的定位是后台集成方案,不适合当基础模板来开发。**
|
||||||
|
- 模板建议使用: [vueAdmin-template](https://github.com/PanJiaChen/vueAdmin-template)
|
||||||
|
- 桌面端: [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
|
||||||
|
|
||||||
|
**注意:该项目使用 element-ui@2.0.0+ 版本,所以最低兼容 vue@2.5.0**
|
||||||
|
|
||||||
|
## 前序准备
|
||||||
|
|
||||||
|
你的本地环境需要安装 [node](http://nodejs.org/) 和 [git](https://git-scm.com/)。我们的技术栈基于 [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/) and [element-ui](https://github.com/ElemeFE/element),所有的请求数据都使用[Mock.js](https://github.com/nuysoft/Mock)模拟,提前了解和学习这些知识会对使用本项目有很大的帮助。
|
||||||
|
|
||||||
|
同时配套一个系列的教程文章,如何从零构建后一个完整的后台项目,建议大家先看完这些文章再来实践本项目
|
||||||
|
- [手摸手,带你用 vue 撸后台 系列一(基础篇)](https://juejin.im/post/59097cd7a22b9d0065fb61d2)
|
||||||
|
- [手摸手,带你用 vue 撸后台 系列二(登录权限篇)](https://juejin.im/post/591aa14f570c35006961acac)
|
||||||
|
- [手摸手,带你用 vue 撸后台 系列三 (实战篇)](https://juejin.im/post/593121aa0ce4630057f70d35)
|
||||||
|
- [手摸手,带你用 vue 撸后台 系列四(vueAdmin 一个极简的后台基础模板)](https://juejin.im/post/595b4d776fb9a06bbe7dba56)
|
||||||
|
- [手摸手,带你封装一个 vue component](https://segmentfault.com/a/1190000009090836)
|
||||||
|
- [手摸手,带你优雅的使用 icon](https://juejin.im/post/59bb864b5188257e7a427c09)
|
||||||
|
|
||||||
|
响应需求,开了一个qq群 `591724180` 方便大家交流
|
||||||
|
|
||||||
|
或者加入该群主 **[圈子](https://jianshiapp.com/circles/1209)** 楼主会经常分享一些技术相关的东西
|
||||||
|
|
||||||
|
**如有问题请先看上述使用文档和文章,若不能满足,欢迎 issue 和 pr**
|
||||||
|
|
||||||
|
**本项目并不是一个脚手架,更倾向于是一个集成解决方案**
|
||||||
|
|
||||||
|
**该项目不支持低版本浏览器(如ie),有需求请自行添加polyfill [详情](https://github.com/PanJiaChen/vue-element-admin/wiki#babel-polyfill)**
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<img width="900" src="https://wpimg.wallstcn.com/a5894c1b-f6af-456e-82df-1151da0839bf.png">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
## 功能
|
||||||
|
```
|
||||||
|
- 登录/注销
|
||||||
|
- 权限验证
|
||||||
|
- 多环境发布
|
||||||
|
- 动态侧边栏(支持多级路由)
|
||||||
|
- 动态面包屑
|
||||||
|
- 国际化多语言
|
||||||
|
- 多种动态换肤
|
||||||
|
- 快捷导航(标签页)
|
||||||
|
- 富文本编辑器
|
||||||
|
- Markdown编辑器
|
||||||
|
- JSON编辑器
|
||||||
|
- Screenfull全屏
|
||||||
|
- 列表拖拽
|
||||||
|
- Svg Sprite 图标
|
||||||
|
- Dashboard
|
||||||
|
- 本地mock数据
|
||||||
|
- Echarts 图表
|
||||||
|
- Clipboard(剪贴复制)
|
||||||
|
- 401/404错误页面
|
||||||
|
- 错误日志
|
||||||
|
- 导出excel
|
||||||
|
- 导出zip
|
||||||
|
- 前端可视化excel
|
||||||
|
- Table example
|
||||||
|
- 动态table example
|
||||||
|
- 拖拽table example
|
||||||
|
- 内联编辑table example
|
||||||
|
- Form example
|
||||||
|
- 二步登录
|
||||||
|
- SplitPane
|
||||||
|
- Dropzone
|
||||||
|
- Sticky
|
||||||
|
- CountTo
|
||||||
|
- Markdown2html
|
||||||
|
```
|
||||||
|
|
||||||
|
## 开发
|
||||||
|
```bash
|
||||||
|
# 克隆项目
|
||||||
|
git clone https://github.com/PanJiaChen/vue-element-admin.git
|
||||||
|
|
||||||
|
# 安装依赖
|
||||||
|
npm install
|
||||||
|
|
||||||
|
# 建议不要用cnpm安装 会有各种诡异的bug 可以通过如下操作解决 npm 下载速度慢的问题
|
||||||
|
npm install --registry=https://registry.npm.taobao.org
|
||||||
|
|
||||||
|
# 启动服务
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
浏览器访问 http://localhost:9527
|
||||||
|
|
||||||
|
## 发布
|
||||||
|
```bash
|
||||||
|
# 构建测试环境
|
||||||
|
npm run build:sit
|
||||||
|
|
||||||
|
# 构建生成环境
|
||||||
|
npm run build:prod
|
||||||
|
```
|
||||||
|
|
||||||
|
## 其它
|
||||||
|
```bash
|
||||||
|
# --report to build with bundle size analytics
|
||||||
|
npm run build:prod --report
|
||||||
|
|
||||||
|
# --preview to start a server in local to preview
|
||||||
|
npm run build:prod --preview
|
||||||
|
|
||||||
|
# lint code
|
||||||
|
npm run lint
|
||||||
|
|
||||||
|
# auto fix
|
||||||
|
npm run lint -- --fix
|
||||||
|
```
|
||||||
|
|
||||||
|
更多信息请参考 [使用文档](https://panjiachen.github.io/vue-element-admin-site/#/deploy)
|
||||||
|
|
||||||
|
## Changelog
|
||||||
|
Detailed changes for each release are documented in the [release notes](https://github.com/PanJiaChen/vue-element-admin/releases).
|
||||||
|
|
||||||
|
## Online Demo
|
||||||
|
[在线 Demo](http://panjiachen.github.io/vue-element-admin)
|
||||||
|
|
||||||
|
## Donate
|
||||||
|
如果你觉得这个项目帮助到了你,你可以帮作者买一杯果汁表示鼓励 :tropical_drink:
|
||||||
|

|
||||||
|
|
||||||
|
[Paypal Me](https://www.paypal.me/panfree23)
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
[MIT](https://github.com/PanJiaChen/vue-element-admin/blob/master/LICENSE)
|
||||||
|
|
||||||
|
Copyright (c) 2017-present PanJiaChen
|
@@ -1,39 +1,48 @@
|
|||||||
require('./check-versions')();
|
'use strict'
|
||||||
var server = require('pushstate-server');
|
require('./check-versions')()
|
||||||
var opn = require('opn')
|
|
||||||
var ora = require('ora')
|
|
||||||
var rm = require('rimraf')
|
|
||||||
var path = require('path')
|
|
||||||
var chalk = require('chalk')
|
|
||||||
var webpack = require('webpack');
|
|
||||||
var config = require('../config');
|
|
||||||
var webpackConfig = require('./webpack.prod.conf');
|
|
||||||
|
|
||||||
var spinner = ora('building for ' + process.env.NODE_ENV + ' of ' + process.env.env_config+ ' mode...' )
|
const ora = require('ora')
|
||||||
|
const rm = require('rimraf')
|
||||||
|
const path = require('path')
|
||||||
|
const chalk = require('chalk')
|
||||||
|
const webpack = require('webpack')
|
||||||
|
const config = require('../config')
|
||||||
|
const webpackConfig = require('./webpack.prod.conf')
|
||||||
|
const server = require('pushstate-server')
|
||||||
|
|
||||||
|
var spinner = ora('building for '+ process.env.env_config+ ' environment...' )
|
||||||
spinner.start()
|
spinner.start()
|
||||||
|
|
||||||
|
|
||||||
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
|
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
|
||||||
|
if (err) throw err
|
||||||
|
webpack(webpackConfig, (err, stats) => {
|
||||||
|
spinner.stop()
|
||||||
if (err) throw err
|
if (err) throw err
|
||||||
webpack(webpackConfig, function (err, stats) {
|
process.stdout.write(stats.toString({
|
||||||
spinner.stop()
|
colors: true,
|
||||||
if (err) throw err
|
modules: false,
|
||||||
process.stdout.write(stats.toString({
|
children: false,
|
||||||
colors: true,
|
chunks: false,
|
||||||
modules: false,
|
chunkModules: false
|
||||||
children: false,
|
}) + '\n\n')
|
||||||
chunks: false,
|
|
||||||
chunkModules: false
|
|
||||||
}) + '\n\n')
|
|
||||||
|
|
||||||
console.log(chalk.cyan(' Build complete.\n'))
|
if (stats.hasErrors()) {
|
||||||
if(process.env.npm_config_preview){
|
console.log(chalk.red(' Build failed with errors.\n'))
|
||||||
server.start({
|
process.exit(1)
|
||||||
port: 9528,
|
}
|
||||||
directory: './dist',
|
|
||||||
file: '/index.html'
|
console.log(chalk.cyan(' Build complete.\n'))
|
||||||
});
|
console.log(chalk.yellow(
|
||||||
console.log('> Listening at ' + 'http://localhost:9528' + '\n')
|
' Tip: built files are meant to be served over an HTTP server.\n' +
|
||||||
}
|
' Opening index.html over file:// won\'t work.\n'
|
||||||
})
|
))
|
||||||
|
if(process.env.npm_config_preview){
|
||||||
|
server.start({
|
||||||
|
port: 9526,
|
||||||
|
directory: './dist',
|
||||||
|
file: '/index.html'
|
||||||
|
});
|
||||||
|
console.log('> Listening at ' + 'http://localhost:9526' + '\n')
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
@@ -1,45 +1,54 @@
|
|||||||
var chalk = require('chalk')
|
'use strict'
|
||||||
var semver = require('semver')
|
const chalk = require('chalk')
|
||||||
var packageConfig = require('../package.json')
|
const semver = require('semver')
|
||||||
|
const packageConfig = require('../package.json')
|
||||||
|
const shell = require('shelljs')
|
||||||
|
|
||||||
function exec(cmd) {
|
function exec (cmd) {
|
||||||
return require('child_process').execSync(cmd).toString().trim()
|
return require('child_process').execSync(cmd).toString().trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
var versionRequirements = [
|
const versionRequirements = [
|
||||||
{
|
{
|
||||||
name: 'node',
|
name: 'node',
|
||||||
currentVersion: semver.clean(process.version),
|
currentVersion: semver.clean(process.version),
|
||||||
versionRequirement: packageConfig.engines.node
|
versionRequirement: packageConfig.engines.node
|
||||||
},
|
}
|
||||||
{
|
|
||||||
name: 'npm',
|
|
||||||
currentVersion: exec('npm --version'),
|
|
||||||
versionRequirement: packageConfig.engines.npm
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (shell.which('npm')) {
|
||||||
|
versionRequirements.push({
|
||||||
|
name: 'npm',
|
||||||
|
currentVersion: exec('npm --version'),
|
||||||
|
versionRequirement: packageConfig.engines.npm
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = function () {
|
module.exports = function () {
|
||||||
var warnings = []
|
const warnings = []
|
||||||
for (var i = 0; i < versionRequirements.length; i++) {
|
|
||||||
var mod = versionRequirements[i]
|
for (let i = 0; i < versionRequirements.length; i++) {
|
||||||
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
|
const mod = versionRequirements[i]
|
||||||
warnings.push(mod.name + ': ' +
|
|
||||||
chalk.red(mod.currentVersion) + ' should be ' +
|
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
|
||||||
chalk.green(mod.versionRequirement)
|
warnings.push(mod.name + ': ' +
|
||||||
)
|
chalk.red(mod.currentVersion) + ' should be ' +
|
||||||
}
|
chalk.green(mod.versionRequirement)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (warnings.length) {
|
||||||
|
console.log('')
|
||||||
|
console.log(chalk.yellow('To use this template, you must update following to modules:'))
|
||||||
|
console.log()
|
||||||
|
|
||||||
|
for (let i = 0; i < warnings.length; i++) {
|
||||||
|
const warning = warnings[i]
|
||||||
|
console.log(' ' + warning)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (warnings.length) {
|
console.log()
|
||||||
console.log('')
|
process.exit(1)
|
||||||
console.log(chalk.yellow('To use this template, you must update following to modules:'))
|
}
|
||||||
console.log()
|
|
||||||
for (var i = 0; i < warnings.length; i++) {
|
|
||||||
var warning = warnings[i]
|
|
||||||
console.log(' ' + warning)
|
|
||||||
}
|
|
||||||
console.log()
|
|
||||||
process.exit(1)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +0,0 @@
|
|||||||
/* eslint-disable */
|
|
||||||
require('eventsource-polyfill')
|
|
||||||
var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
|
|
||||||
|
|
||||||
hotClient.subscribe(function (event) {
|
|
||||||
if (event.action === 'reload') {
|
|
||||||
window.location.reload()
|
|
||||||
}
|
|
||||||
})
|
|
@@ -1,93 +0,0 @@
|
|||||||
require('./check-versions')(); // 检查 Node 和 npm 版本
|
|
||||||
|
|
||||||
var config = require('../config');
|
|
||||||
if (!process.env.NODE_ENV) {
|
|
||||||
process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
|
|
||||||
}
|
|
||||||
|
|
||||||
var opn = require('opn')
|
|
||||||
var path = require('path');
|
|
||||||
var express = require('express');
|
|
||||||
var webpack = require('webpack');
|
|
||||||
var proxyMiddleware = require('http-proxy-middleware');
|
|
||||||
var webpackConfig = require('./webpack.dev.conf');
|
|
||||||
|
|
||||||
// default port where dev server listens for incoming traffic
|
|
||||||
var port = process.env.PORT || config.dev.port;
|
|
||||||
// automatically open browser, if not set will be false
|
|
||||||
var autoOpenBrowser = !!config.dev.autoOpenBrowser;
|
|
||||||
// Define HTTP proxies to your custom API backend
|
|
||||||
// https://github.com/chimurai/http-proxy-middleware
|
|
||||||
var proxyTable = config.dev.proxyTable;
|
|
||||||
|
|
||||||
var app = express();
|
|
||||||
var compiler = webpack(webpackConfig);
|
|
||||||
|
|
||||||
var devMiddleware = require('webpack-dev-middleware')(compiler, {
|
|
||||||
publicPath: webpackConfig.output.publicPath,
|
|
||||||
quiet: true
|
|
||||||
});
|
|
||||||
|
|
||||||
var hotMiddleware = require('webpack-hot-middleware')(compiler, {
|
|
||||||
log: false,
|
|
||||||
heartbeat: 2000
|
|
||||||
});
|
|
||||||
|
|
||||||
// force page reload when html-webpack-plugin template changes
|
|
||||||
// currently disabled until this is resolved:
|
|
||||||
// https://github.com/jantimon/html-webpack-plugin/issues/680
|
|
||||||
// compiler.plugin('compilation', function (compilation) {
|
|
||||||
// compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
|
|
||||||
// hotMiddleware.publish({ action: 'reload' })
|
|
||||||
// cb()
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
|
|
||||||
// proxy api requests
|
|
||||||
Object.keys(proxyTable).forEach(function (context) {
|
|
||||||
var options = proxyTable[context]
|
|
||||||
if (typeof options === 'string') {
|
|
||||||
options = {target: options}
|
|
||||||
}
|
|
||||||
app.use(proxyMiddleware(options.filter || context, options))
|
|
||||||
});
|
|
||||||
|
|
||||||
// handle fallback for HTML5 history API
|
|
||||||
app.use(require('connect-history-api-fallback')());
|
|
||||||
|
|
||||||
// serve webpack bundle output
|
|
||||||
app.use(devMiddleware);
|
|
||||||
|
|
||||||
// enable hot-reload and state-preserving
|
|
||||||
// compilation error display
|
|
||||||
app.use(hotMiddleware);
|
|
||||||
|
|
||||||
// serve pure static assets
|
|
||||||
var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory);
|
|
||||||
app.use(staticPath, express.static('./static'));
|
|
||||||
|
|
||||||
var uri = 'http://localhost:' + port
|
|
||||||
|
|
||||||
var _resolve
|
|
||||||
var readyPromise = new Promise(resolve => {
|
|
||||||
_resolve = resolve
|
|
||||||
})
|
|
||||||
|
|
||||||
console.log('> Starting dev server...')
|
|
||||||
devMiddleware.waitUntilValid(() => {
|
|
||||||
console.log('> Listening at ' + uri + '\n')
|
|
||||||
// when env is testing, don't need open it
|
|
||||||
if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') {
|
|
||||||
opn(uri)
|
|
||||||
}
|
|
||||||
_resolve()
|
|
||||||
})
|
|
||||||
|
|
||||||
var server = app.listen(port)
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
ready: readyPromise,
|
|
||||||
close: () => {
|
|
||||||
server.close()
|
|
||||||
}
|
|
||||||
}
|
|
BIN
build/logo.png
Normal file
BIN
build/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
@@ -1,35 +1,38 @@
|
|||||||
var path = require('path')
|
'use strict'
|
||||||
var config = require('../config')
|
const path = require('path')
|
||||||
var ExtractTextPlugin = require('extract-text-webpack-plugin')
|
const config = require('../config')
|
||||||
|
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||||
|
const packageConfig = require('../package.json')
|
||||||
|
|
||||||
exports.assetsPath = function (_path) {
|
exports.assetsPath = function (_path) {
|
||||||
var assetsSubDirectory = process.env.NODE_ENV === 'production'
|
const assetsSubDirectory = process.env.NODE_ENV === 'production'
|
||||||
? config.build.assetsSubDirectory
|
? config.build.assetsSubDirectory
|
||||||
: config.dev.assetsSubDirectory
|
: config.dev.assetsSubDirectory
|
||||||
|
|
||||||
return path.posix.join(assetsSubDirectory, _path)
|
return path.posix.join(assetsSubDirectory, _path)
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.cssLoaders = function (options) {
|
exports.cssLoaders = function (options) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
|
|
||||||
var cssLoader = {
|
const cssLoader = {
|
||||||
loader: 'css-loader',
|
loader: 'css-loader',
|
||||||
options: {
|
options: {
|
||||||
minimize: process.env.NODE_ENV === 'production',
|
|
||||||
sourceMap: options.sourceMap
|
sourceMap: options.sourceMap
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var postcssLoader = {
|
const postcssLoader = {
|
||||||
loader: 'postcss-loader',
|
loader: 'postcss-loader',
|
||||||
options: {
|
options: {
|
||||||
sourceMap: true
|
sourceMap: options.sourceMap
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// generate loader string to be used with extract text plugin
|
// generate loader string to be used with extract text plugin
|
||||||
function generateLoaders (loader, loaderOptions) {
|
function generateLoaders (loader, loaderOptions) {
|
||||||
var loaders = options.usePostCSS !== false ? [cssLoader, postcssLoader] : [cssLoader]
|
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
|
||||||
|
|
||||||
if (loader) {
|
if (loader) {
|
||||||
loaders.push({
|
loaders.push({
|
||||||
loader: loader + '-loader',
|
loader: loader + '-loader',
|
||||||
@@ -65,14 +68,34 @@ exports.cssLoaders = function (options) {
|
|||||||
|
|
||||||
// Generate loaders for standalone style files (outside of .vue)
|
// Generate loaders for standalone style files (outside of .vue)
|
||||||
exports.styleLoaders = function (options) {
|
exports.styleLoaders = function (options) {
|
||||||
var output = []
|
const output = []
|
||||||
var loaders = exports.cssLoaders(options)
|
const loaders = exports.cssLoaders(options)
|
||||||
for (var extension in loaders) {
|
|
||||||
var loader = loaders[extension]
|
for (const extension in loaders) {
|
||||||
|
const loader = loaders[extension]
|
||||||
output.push({
|
output.push({
|
||||||
test: new RegExp('\\.' + extension + '$'),
|
test: new RegExp('\\.' + extension + '$'),
|
||||||
use: loader
|
use: loader
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return output
|
return output
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports.createNotifierCallback = () => {
|
||||||
|
const notifier = require('node-notifier')
|
||||||
|
|
||||||
|
return (severity, errors) => {
|
||||||
|
if (severity !== 'error') return
|
||||||
|
|
||||||
|
const error = errors[0]
|
||||||
|
const filename = error.file && error.file.split('!').pop()
|
||||||
|
|
||||||
|
notifier.notify({
|
||||||
|
title: packageConfig.name,
|
||||||
|
message: severity + ': ' + error.name,
|
||||||
|
subtitle: filename || '',
|
||||||
|
icon: path.join(__dirname, 'logo.png')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -1,12 +1,22 @@
|
|||||||
var utils = require('./utils')
|
'use strict'
|
||||||
var config = require('../config')
|
const utils = require('./utils')
|
||||||
var isProduction = process.env.NODE_ENV === 'production'
|
const config = require('../config')
|
||||||
|
const isProduction = process.env.NODE_ENV === 'production'
|
||||||
|
const sourceMapEnabled = isProduction
|
||||||
|
? config.build.productionSourceMap
|
||||||
|
: config.dev.cssSourceMap
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
loaders: utils.cssLoaders({
|
loaders: utils.cssLoaders({
|
||||||
sourceMap: isProduction
|
sourceMap: sourceMapEnabled,
|
||||||
? config.build.productionSourceMap
|
extract: isProduction
|
||||||
: config.dev.cssSourceMap,
|
}),
|
||||||
extract: isProduction
|
cssSourceMap: sourceMapEnabled,
|
||||||
})
|
cacheBusting: config.dev.cacheBusting,
|
||||||
|
transformToRequire: {
|
||||||
|
video: ['src', 'poster'],
|
||||||
|
source: 'src',
|
||||||
|
img: 'src',
|
||||||
|
image: 'xlink:href'
|
||||||
|
}
|
||||||
}
|
}
|