diff --git a/.babelrc b/.babelrc
deleted file mode 100644
index b4050098993..00000000000
--- a/.babelrc
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "presets": [
- ["env", { "modules": false }],
- "stage-2"
- ],
- "plugins": ["transform-runtime"],
- "comments": false
-}
diff --git a/.editorconfig b/.editorconfig
index ea6e20f5b2e..3454886e3a5 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,4 +1,4 @@
-# http://editorconfig.org
+# https://editorconfig.org
root = true
[*]
diff --git a/.env.development b/.env.development
new file mode 100644
index 00000000000..de583d0940d
--- /dev/null
+++ b/.env.development
@@ -0,0 +1,5 @@
+# just a flag
+ENV = 'development'
+
+# base api
+VUE_APP_BASE_API = '/dev-api'
diff --git a/.env.production b/.env.production
new file mode 100644
index 00000000000..80c810301f3
--- /dev/null
+++ b/.env.production
@@ -0,0 +1,6 @@
+# just a flag
+ENV = 'production'
+
+# base api
+VUE_APP_BASE_API = '/prod-api'
+
diff --git a/.env.staging b/.env.staging
new file mode 100644
index 00000000000..a8793a09891
--- /dev/null
+++ b/.env.staging
@@ -0,0 +1,8 @@
+NODE_ENV = production
+
+# just a flag
+ENV = 'staging'
+
+# base api
+VUE_APP_BASE_API = '/stage-api'
+
diff --git a/.eslintignore b/.eslintignore
index e3a4037e479..e6529fc09c9 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,3 +1,4 @@
build/*.js
-config/*.js
src/assets
+public
+dist
diff --git a/.eslintrc.js b/.eslintrc.js
index 006e9824d78..c977505478d 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,144 +1,198 @@
module.exports = {
- root: true,
+ root: true,
+ parserOptions: {
parser: 'babel-eslint',
- parserOptions: {
- sourceType: 'module'
- },
- env: {
- browser: true,
- node: true,
- es6: true,
- },
- extends: 'eslint:recommended',
- // required to lint *.vue files
- plugins: [
- 'html'
- ],
- // check if imports actually resolve
- 'settings': {
- 'import/resolver': {
- 'webpack': {
- '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': 2,
- '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']
- }
+ sourceType: 'module'
+ },
+ env: {
+ browser: true,
+ node: true,
+ es6: true,
+ },
+ extends: ['plugin:vue/recommended', 'eslint:recommended'],
+
+ // add your custom rules here
+ //it is base on https://github.com/vuejs/eslint-config-vue
+ rules: {
+ "vue/max-attributes-per-line": [2, {
+ "singleline": 10,
+ "multiline": {
+ "max": 1,
+ "allowFirstLine": false
+ }
+ }],
+ "vue/singleline-html-element-content-newline": "off",
+ "vue/multiline-html-element-content-newline":"off",
+ "vue/name-property-casing": ["error", "PascalCase"],
+ "vue/no-v-html": "off",
+ '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': ["error", "always", {"null": "ignore"}],
+ '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']
+ }
}
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 00000000000..d540802752b
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1,4 @@
+# These are supported funding model platforms
+
+patreon: panjiachen
+custom: https://panjiachen.github.io/vue-element-admin-site/donate
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100755
index 00000000000..1a114bc0044
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,33 @@
+---
+name: Bug report(报告问题)
+about: Create a report to help us improve
+---
+
+
+
+## Bug report(问题描述)
+
+#### Steps to reproduce(问题复现步骤)
+
+
+#### Screenshot or Gif(截图或动态图)
+
+
+#### Link to minimal reproduction(最小可在线还原demo)
+
+
+
+#### Other relevant information(格外信息)
+- Your OS:
+- Node.js version:
+- vue-element-admin version:
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100755
index 00000000000..c33d10d4621
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,7 @@
+---
+name: Feature Request(新功能建议)
+about: Suggest an idea for this project
+---
+
+## Feature request(新功能建议)
+
diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md
new file mode 100755
index 00000000000..76083546d30
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/question.md
@@ -0,0 +1,35 @@
+---
+name: Question(提问)
+about: Asking questions about use
+---
+
+## Question(提问)
+
+
+
+#### Steps to reproduce(问题复现步骤)
+
+
+#### Screenshot or Gif(截图或动态图)
+
+
+#### Link to minimal reproduction(最小可在线还原demo)
+
+
+
+#### Other relevant information(格外信息)
+- Your OS:
+- Node.js version:
+- vue-element-admin version:
diff --git a/.gitignore b/.gitignore
index a5060b02477..78a752d87e8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,23 @@
.DS_Store
node_modules/
dist/
-static/ckeditor
-gifs/
-npm-debug.log
-test/unit/coverage
-test/e2e/reports
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+**/*.log
+
+tests/**/coverage/
+tests/e2e/reports
selenium-debug.log
+
+# Editor directories and files
.idea
+.vscode
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.local
+
+package-lock.json
+yarn.lock
diff --git a/.postcssrc.js b/.postcssrc.js
deleted file mode 100644
index ea9a5ab8752..00000000000
--- a/.postcssrc.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// https://github.com/michael-ciniawsky/postcss-load-config
-
-module.exports = {
- "plugins": {
- // to edit target browsers: use "browserlist" field in package.json
- "autoprefixer": {}
- }
-}
diff --git a/.travis.yml b/.travis.yml
new file mode 100755
index 00000000000..f4be7a08559
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,5 @@
+language: node_js
+node_js: 10
+script: npm run test
+notifications:
+ email: false
diff --git a/LICENSE b/LICENSE
index b4bb0d9fbf9..61515750df8 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2017 PanJiaChen
+Copyright (c) 2017-present PanJiaChen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README-en.md b/README-en.md
deleted file mode 100644
index 39d4c8921bb..00000000000
--- a/README-en.md
+++ /dev/null
@@ -1,175 +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
-- Exporting to Excel
-- Upload Excel
-- 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
-
-## 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
-
-
-
-#### 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
diff --git a/README.es.md b/README.es.md
new file mode 100644
index 00000000000..dc20fa42124
--- /dev/null
+++ b/README.es.md
@@ -0,0 +1,228 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

Get Java backend for Vue admin with 20% discount for 39$ use coupon code SWB0RAZPZR1M +
+ +### Flatlogic + +
Admin Dashboard Templates made with Vue, React and Angular.
+ +## Características + +``` +- Iniciar / Cerrar Sesión + +- Permisos de Autenticación + - Página de Permisos + - Directivas de permisos + - Página de configuración de permisos + - Autenticación por dos pasos + +- Construcción Multi-entorno + - Desarrollo (dev) + - sit + - Escenario de pruebas (stage), + - Producción (prod) + +- Características Globales + - I18n + - Temas dinámicos + - Menu lateral dinámico (soporte a rutas multi-nivel) + - Barra de rutas dinámica + - Tags-view (Pestañas de página, Soporta operación de clic derecho) + - Svg Sprite + - Datos de simulación con Mock + - Pantalla completa + - Menu lateral responsivo + +- Editor + - Editor de Texto Enriquecido + - Editor Markdown + - Editor JSON + +- Excel + - Exportación a Excel + - Carga de Excel + - Visualización de Excel + - Exportación como ZIP + +- Tabla + - Tabla Dinámica + - Tabla con Arrastrar y Soltar + - Tabla de edición en línea + +- Páginas de Error + - 401 + - 404 + +- Componentes + - Carga de Avatar + - Botón para subir al inicio + - Arrastrar y Soltar (Diaglogo) + - Arrastrar y Soltar (Seleccionar) + - Arrastrar y Soltar (Kanban) + - Arrastrar y Soltar (Lista) + - Panel de división + - Componente para soltar archivos + - Adhesión de objetos + - Contador hasta + +- Ejemplo Avanzado +- Registro de Errores +- Tablero de indicadores +- Página de Guías +- ECharts (Gráficos) +- Portapapeles +- Convertidor de Markdown a HTML +``` + +## Iniciando + +```bash +# clone el proyecto +git clone https://github.com/PanJiaChen/vue-element-admin.git + +# vaya al directorio clonado +cd vue-element-admin + +# instale las dependencias +npm install + +# corra el proyecto como desarrollador +npm run dev +``` + +Automáticamente se abrirá el siguiente enlace en su navegador http://localhost:9527 + +## Construcción + +```bash +# Construcción para entornos de prueba +npm run build:stage + +# Construcción para entornos de producción +npm run build:prod +``` + +## Avanzado + +```bash +# Vista previa con efectos de entorno +npm run preview + +# Vista previa con efectos + análisis de recursos estáticos +npm run preview -- --report + +# Chequeo de formato de código +npm run lint + +# Chequeo de formato de código y auto-corrección +npm run lint -- --fix +``` + +Vaya a [Documentación](https://panjiachen.github.io/vue-element-admin-site/guide/essentials/deploy.html) para mayor información + +## Registro de Cambios + +Los cambios detallados por cada liberación se encuentran en [notas de liberación](https://github.com/PanJiaChen/vue-element-admin/releases). + +## Demostración en línea + +[Vista Prévia de la Aplicación](https://panjiachen.github.io/vue-element-admin) + +## Donación + +Si este proyecto es de mucha ayuda para ti, puedes comprarle al autor un vaso de jugo :tropical_drink: + + + +[dona por Paypal](https://www.paypal.me/panfree23) + +[Comprame un Café](https://www.buymeacoffee.com/Pan) + +## Navegadores Soportados + +Navegadores modernos e Internet Explorer 10+. + +| [
](https://godban.github.io/browsers-support-badges/)IE / Edge | [
](https://godban.github.io/browsers-support-badges/)Firefox | [
](https://godban.github.io/browsers-support-badges/)Chrome | [
](https://godban.github.io/browsers-support-badges/)Safari |
+| --------- | --------- | --------- | --------- |
+| IE10, IE11, Edge | últimas 2 versiones | últimas 2 versiones | últimas 2 versiones |
+
+## Licencia
+
+[MIT](https://github.com/PanJiaChen/vue-element-admin/blob/master/LICENSE)
+
+Copyright (c) 2017-presente PanJiaChen
diff --git a/README.ja.md b/README.ja.md
new file mode 100644
index 00000000000..3bc3ce8bf0f
--- /dev/null
+++ b/README.ja.md
@@ -0,0 +1,224 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

Get Java backend for Vue admin with 20% discount for 39$ use coupon code SWB0RAZPZR1M +
+ +### Flatlogic + +
Admin Dashboard Templates made with Vue, React and Angular.
+ +## 機能一覧 + +``` +- ログイン / ログアウト + +- Auth認証 + - ページ権限 + - 権限パーミッション + - 権限設定 + - 外部IDでログイン + +- 複数環境デプロイ + - dev + - sit + - stage + - prod + +- 共通機能 + - 多言語切替 + - テーマ切替 + - サイトメニュー(ルートから生成) + - パンくずリストナビゲーション + - タブナビゲーション + - Svg Sprite アイコン + - ローカル/バックエンド モック データ + - Screenfull + +- WYSIWYG + - TinyMCE + - Markdown + - JSON + +- Excel + - エクスポート + - インポート + - リード + - Zip + +- テーブル + - ダイナミックテーブル + - ドラッグアンドドロップテーブル + - インラインエディットテーブル + +- エラーページ + - 401 + - 404 + +- コンポーネント + - アバターアップロード + - トップに戻る + - ドラッグダイアログ + - ドラッグ選択 + - ドラッグKanban + - ドラッグリスト + - ペインの分割 + - Dropzone + - スティッキー + - CountTo + +- 高度なサンプル +- エラーログ +- ダッシュボード +- ガイドページ +- ECharts +- クリップボード +- Markdown to html +``` + +## Getting started + +```bash +# clone the project +git clone https://github.com/PanJiaChen/vue-element-admin.git + +# enter the project directory +cd vue-element-admin + +# install dependency +npm install + +# develop +npm run dev +``` + +http://localhost:9527 が自動的に開きます。 + +## Build + +```bash +# build for test environment +npm run build:stage + +# build for production environment +npm run build:prod +``` + +## Advanced + +```bash +# preview the release environment effect +npm run preview + +# preview the release environment effect + static resource analysis +npm run preview -- --report + +# code format check +npm run lint + +# code format check and auto fix +npm run lint -- --fix +``` + +詳細は [Documentation](https://panjiachen.github.io/vue-element-admin-site/guide/essentials/deploy.html) を参照してください。 + +## Changelog + +各リリースの詳細は [release notes](https://github.com/PanJiaChen/vue-element-admin/releases) にあります。 + +## Online Demo + +[Preview](https://panjiachen.github.io/vue-element-admin) + +## Donate + +If you find this project useful, you can buy author a glass of juice :tropical_drink: + + + +[Paypal Me](https://www.paypal.me/panfree23) + +[Buy me a coffee](https://www.buymeacoffee.com/Pan) + +## Browsers support + +Modern browsers and Internet Explorer 10+. + +| [
](https://godban.github.io/browsers-support-badges/)IE / Edge | [
](https://godban.github.io/browsers-support-badges/)Firefox | [
](https://godban.github.io/browsers-support-badges/)Chrome | [
](https://godban.github.io/browsers-support-badges/)Safari |
+| --------- | --------- | --------- | --------- |
+| IE10, IE11, Edge | last 2 versions | last 2 versions | last 2 versions |
+
+## License
+
+[MIT](https://github.com/PanJiaChen/vue-element-admin/blob/master/LICENSE)
+
+Copyright (c) 2017-present PanJiaChen
diff --git a/README.md b/README.md
index 34e78b92072..bb677a4383a 100644
--- a/README.md
+++ b/README.md
@@ -1,209 +1,243 @@
-# vue-element-admin #
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

Get Java backend for Vue admin with 20% discount for 39$ use coupon code SWB0RAZPZR1M +
- # 安装依赖 - npm install - //or # 建议不要用cnpm 安装有各种诡异的bug 可以通过如下操作解决npm速度慢的问题 - npm install --registry=https://registry.npm.taobao.org +### Flatlogic - # 本地开发 开启服务 - npm run dev -``` -浏览器访问 http://localhost:9527 +
Admin Dashboard Templates made with Vue, React and Angular.
-## 发布 -```bash - # 发布测试环境 带webpack ananalyzer - npm run build:sit-preview +## Features - # 构建生成环境 - npm run build:prod ``` - -## 目录结构 -```shell -├── build // 构建相关 -├── config // 配置相关 -├── src // 源代码 -│ ├── api // 所有请求 -│ ├── assets // 主题 字体等静态资源 -│ ├── components // 全局公用组件 -│ ├── directive // 全局指令 -│ ├── filtres // 全局filter -│ ├── mock // mock数据 -│ ├── router // 路由 -│ ├── store // 全局store管理 -│ ├── styles // 全局样式 -│ ├── utils // 全局公用方法 -│ ├── view // view -│ ├── App.vue // 入口页面 -│ └── main.js // 入口 加载组件 初始化等 -├── static // 第三方不打包资源 -│ └── Tinymce // 富文本 -├── .babelrc // babel-loader 配置 -├── eslintrc.js // eslint 配置项 -├── .gitignore // git 忽略项 -├── favicon.ico // favicon图标 -├── index.html // html模板 -└── package.json // package.json - +- Login / Logout + +- Permission Authentication + - Page permission + - Directive permission + - Permission configuration page + - Two-step login + +- Multi-environment build + - Develop (dev) + - sit + - Stage Test (stage) + - Production (prod) + +- Global Features + - I18n + - Multiple dynamic themes + - Dynamic sidebar (supports multi-level routing) + - Dynamic breadcrumb + - Tags-view (Tab page Support right-click operation) + - Svg Sprite + - Mock data + - Screenfull + - Responsive Sidebar + +- Editor + - Rich Text Editor + - Markdown Editor + - JSON Editor + +- Excel + - Export Excel + - Upload Excel + - Visualization Excel + - Export zip + +- Table + - Dynamic Table + - Drag And Drop Table + - Inline Edit Table + +- Error Page + - 401 + - 404 + +- Components + - Avatar Upload + - Back To Top + - Drag Dialog + - Drag Select + - Drag Kanban + - Drag List + - SplitPane + - Dropzone + - Sticky + - CountTo + +- Advanced Example +- Error Log +- Dashboard +- Guide Page +- ECharts +- Clipboard +- Markdown to html ``` -## 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 - - -## 状态管理 -后台只有user和app配置相关状态使用vuex存在全局,其它数据都由每个业务页面自己管理。 - - -## 效果图 - -#### 两步验证登录 支持微信和qq - - - -#### 真正的动态换肤 - -
](https://godban.github.io/browsers-support-badges/)IE / Edge | [
](https://godban.github.io/browsers-support-badges/)Firefox | [
](https://godban.github.io/browsers-support-badges/)Chrome | [
](https://godban.github.io/browsers-support-badges/)Safari |
+| --------- | --------- | --------- | --------- |
+| IE10, IE11, Edge | last 2 versions | last 2 versions | last 2 versions |
## License
-MIT
+[MIT](https://github.com/PanJiaChen/vue-element-admin/blob/master/LICENSE)
+
+Copyright (c) 2017-present PanJiaChen
diff --git a/README.zh-CN.md b/README.zh-CN.md
new file mode 100644
index 00000000000..a14858a4d08
--- /dev/null
+++ b/README.zh-CN.md
@@ -0,0 +1,266 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

Java 后端整合,可以使用优惠码:SWB0RAZPZR1M,获得20%的价格优化
+ +### Flatlogic + +
Admin Dashboard Templates made with Vue, React and Angular.
+ + +## 功能 + +``` +- 登录 / 注销 + +- 权限验证 + - 页面权限 + - 指令权限 + - 权限配置 + - 二步登录 + +- 多环境发布 + - dev + - sit + - stage + - prod + +- 全局功能 + - 国际化多语言 + - 多种动态换肤 + - 动态侧边栏(支持多级路由嵌套) + - 动态面包屑 + - 快捷导航(标签页) + - Svg Sprite 图标 + - 本地/后端 mock 数据 + - Screenfull全屏 + - 自适应收缩侧边栏 + +- 编辑器 + - 富文本 + - Markdown + - JSON 等多格式 + +- Excel + - 导出excel + - 导入excel + - 前端可视化excel + - 导出zip + +- 表格 + - 动态表格 + - 拖拽表格 + - 内联编辑 + +- 错误页面 + - 401 + - 404 + +- 組件 + - 头像上传 + - 返回顶部 + - 拖拽Dialog + - 拖拽Select + - 拖拽看板 + - 列表拖拽 + - SplitPane + - Dropzone + - Sticky + - CountTo + +- 综合实例 +- 错误日志 +- Dashboard +- 引导页 +- ECharts 图表 +- Clipboard(剪贴复制) +- Markdown2html +``` + +## 开发 + +```bash +# 克隆项目 +git clone https://github.com/PanJiaChen/vue-element-admin.git + +# 进入项目目录 +cd vue-element-admin + +# 安装依赖 +npm install + +# 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题 +npm install --registry=https://registry.npm.taobao.org + +# 启动服务 +npm run dev +``` + +浏览器访问 http://localhost:9527 + +## 发布 + +```bash +# 构建测试环境 +npm run build:stage + +# 构建生产环境 +npm run build:prod +``` + +## 其它 + +```bash +# 预览发布环境效果 +npm run preview + +# 预览发布环境效果 + 静态资源分析 +npm run preview -- --report + +# 代码格式检查 +npm run lint + +# 代码格式检查并自动修复 +npm run lint -- --fix +``` + +更多信息请参考 [使用文档](https://panjiachen.github.io/vue-element-admin-site/zh/) + +## Changelog + +Detailed changes for each release are documented in the [release notes](https://github.com/PanJiaChen/vue-element-admin/releases). + +## Online Demo + +[在线 Demo](https://panjiachen.github.io/vue-element-admin) + +## Donate + +如果你觉得这个项目帮助到了你,你可以帮作者买一杯果汁表示鼓励 :tropical_drink: + + +[更多捐赠方式](https://panjiachen.gitee.io/vue-element-admin-site/zh/donate) + +[Paypal Me](https://www.paypal.me/panfree23) + +[Buy me a coffee](https://www.buymeacoffee.com/Pan) + +## 购买贴纸 + +你也可以通过 购买[官方授权的贴纸](https://smallsticker.com/product/vue-element-admin) 的方式来支持 vue-element-admin - 每售出一张贴纸,本项目将获得 2 元的捐赠。 + +## Browsers support + +Modern browsers and Internet Explorer 10+. + +| [
](https://godban.github.io/browsers-support-badges/)IE / Edge | [
](https://godban.github.io/browsers-support-badges/)Firefox | [
](https://godban.github.io/browsers-support-badges/)Chrome | [
](https://godban.github.io/browsers-support-badges/)Safari |
+| --------- | --------- | --------- | --------- |
+| IE10, IE11, Edge | last 2 versions | last 2 versions | last 2 versions |
+
+## License
+
+[MIT](https://github.com/PanJiaChen/vue-element-admin/blob/master/LICENSE)
+
+Copyright (c) 2017-present PanJiaChen
diff --git a/babel.config.js b/babel.config.js
new file mode 100644
index 00000000000..fb82b2715f4
--- /dev/null
+++ b/babel.config.js
@@ -0,0 +1,14 @@
+module.exports = {
+ presets: [
+ // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app
+ '@vue/cli-plugin-babel/preset'
+ ],
+ 'env': {
+ 'development': {
+ // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().
+ // This plugin can significantly increase the speed of hot updates, when you have a large number of pages.
+ // https://panjiachen.github.io/vue-element-admin-site/guide/advanced/lazy-loading.html
+ 'plugins': ['dynamic-import-node']
+ }
+ }
+}
diff --git a/build/build.js b/build/build.js
deleted file mode 100644
index da9522a10f0..00000000000
--- a/build/build.js
+++ /dev/null
@@ -1,41 +0,0 @@
-require('./check-versions')();
-var server = require('pushstate-server');
-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');
-
-console.log(process.env.NODE_ENV)
-
-var spinner = ora('building for ' + process.env.NODE_ENV + '...')
-spinner.start()
-
-
-rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
- if (err) throw err
- webpack(webpackConfig, function (err, stats) {
- spinner.stop()
- if (err) throw err
- process.stdout.write(stats.toString({
- colors: true,
- modules: false,
- children: false,
- chunks: false,
- chunkModules: false
- }) + '\n\n')
-
- console.log(chalk.cyan(' Build complete.\n'))
- if(process.env.npm_config_preview){
- server.start({
- port: 9528,
- directory: './dist',
- file: '/index.html'
- });
- console.log('> Listening at ' + 'http://localhost:9528/' + '\n')
- }
- })
-})
diff --git a/build/check-versions.js b/build/check-versions.js
deleted file mode 100644
index 3a1dda61e98..00000000000
--- a/build/check-versions.js
+++ /dev/null
@@ -1,45 +0,0 @@
-var chalk = require('chalk')
-var semver = require('semver')
-var packageConfig = require('../package.json')
-
-function exec(cmd) {
- return require('child_process').execSync(cmd).toString().trim()
-}
-
-var versionRequirements = [
- {
- name: 'node',
- currentVersion: semver.clean(process.version),
- versionRequirement: packageConfig.engines.node
- },
- {
- name: 'npm',
- currentVersion: exec('npm --version'),
- versionRequirement: packageConfig.engines.npm
- }
-]
-
-module.exports = function () {
- var warnings = []
- for (var i = 0; i < versionRequirements.length; i++) {
- var mod = versionRequirements[i]
- if (!semver.satisfies(mod.currentVersion, 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 (var i = 0; i < warnings.length; i++) {
- var warning = warnings[i]
- console.log(' ' + warning)
- }
- console.log()
- process.exit(1)
- }
-}
diff --git a/build/dev-client.js b/build/dev-client.js
deleted file mode 100644
index 18aa1e21952..00000000000
--- a/build/dev-client.js
+++ /dev/null
@@ -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()
- }
-})
diff --git a/build/dev-server.js b/build/dev-server.js
deleted file mode 100644
index 34c32b3c348..00000000000
--- a/build/dev-server.js
+++ /dev/null
@@ -1,84 +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: () => {
- }
-});
-
-// force page reload when html-webpack-plugin template changes
-compiler.plugin('compilation', function (compilation) {
- compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
- hotMiddleware.publish({action: 'reload'});
- cb()
- })
-});
-
-// compiler.apply(new DashboardPlugin());
-
-// 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
-
-devMiddleware.waitUntilValid(function () {
- console.log('> Listening at ' + uri + '\n')
-});
-
-module.exports = app.listen(port, function (err) {
- if (err) {
- console.log(err);
- return
- }
-
- // when env is testing, don't need open it
- if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') {
- opn(uri)
- }
-});
diff --git a/build/index.js b/build/index.js
new file mode 100644
index 00000000000..0c57de2aad9
--- /dev/null
+++ b/build/index.js
@@ -0,0 +1,35 @@
+const { run } = require('runjs')
+const chalk = require('chalk')
+const config = require('../vue.config.js')
+const rawArgv = process.argv.slice(2)
+const args = rawArgv.join(' ')
+
+if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
+ const report = rawArgv.includes('--report')
+
+ run(`vue-cli-service build ${args}`)
+
+ const port = 9526
+ const publicPath = config.publicPath
+
+ var connect = require('connect')
+ var serveStatic = require('serve-static')
+ const app = connect()
+
+ app.use(
+ publicPath,
+ serveStatic('./dist', {
+ index: ['index.html', '/']
+ })
+ )
+
+ app.listen(port, function () {
+ console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`))
+ if (report) {
+ console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`))
+ }
+
+ })
+} else {
+ run(`vue-cli-service build ${args}`)
+}
diff --git a/build/utils.js b/build/utils.js
deleted file mode 100644
index b1d54b4d6c5..00000000000
--- a/build/utils.js
+++ /dev/null
@@ -1,71 +0,0 @@
-var path = require('path')
-var config = require('../config')
-var ExtractTextPlugin = require('extract-text-webpack-plugin')
-
-exports.assetsPath = function (_path) {
- var assetsSubDirectory = process.env.NODE_ENV === 'production'
- ? config.build.assetsSubDirectory
- : config.dev.assetsSubDirectory
- return path.posix.join(assetsSubDirectory, _path)
-}
-
-exports.cssLoaders = function (options) {
- options = options || {}
-
- var cssLoader = {
- loader: 'css-loader',
- options: {
- minimize: process.env.NODE_ENV === 'production',
- sourceMap: options.sourceMap
- }
- }
-
- // generate loader string to be used with extract text plugin
- function generateLoaders (loader, loaderOptions) {
- var loaders = [cssLoader]
- if (loader) {
- loaders.push({
- loader: loader + '-loader',
- options: Object.assign({}, loaderOptions, {
- sourceMap: options.sourceMap
- })
- })
- }
-
- // Extract CSS when that option is specified
- // (which is the case during production build)
- if (options.extract) {
- return ExtractTextPlugin.extract({
- use: loaders,
- fallback: 'vue-style-loader'
- })
- } else {
- return ['vue-style-loader'].concat(loaders)
- }
- }
-
- // https://vue-loader.vuejs.org/en/configurations/extract-css.html
- return {
- css: generateLoaders(),
- postcss: generateLoaders(),
- less: generateLoaders('less'),
- sass: generateLoaders('sass', { indentedSyntax: true }),
- scss: generateLoaders('sass'),
- stylus: generateLoaders('stylus'),
- styl: generateLoaders('stylus')
- }
-}
-
-// Generate loaders for standalone style files (outside of .vue)
-exports.styleLoaders = function (options) {
- var output = []
- var loaders = exports.cssLoaders(options)
- for (var extension in loaders) {
- var loader = loaders[extension]
- output.push({
- test: new RegExp('\\.' + extension + '$'),
- use: loader
- })
- }
- return output
-}
diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js
deleted file mode 100644
index d7df7e57270..00000000000
--- a/build/vue-loader.conf.js
+++ /dev/null
@@ -1,12 +0,0 @@
-var utils = require('./utils')
-var config = require('../config')
-var isProduction = process.env.NODE_ENV === 'production'
-
-module.exports = {
- loaders: utils.cssLoaders({
- sourceMap: isProduction
- ? config.build.productionSourceMap
- : config.dev.cssSourceMap,
- extract: isProduction
- })
-}
diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js
deleted file mode 100644
index d82a880cf0b..00000000000
--- a/build/webpack.base.conf.js
+++ /dev/null
@@ -1,92 +0,0 @@
-var path = require('path')
-var utils = require('./utils')
-var config = require('../config')
-var vueLoaderConfig = require('./vue-loader.conf')
-
-function resolve(dir) {
- return path.join(__dirname, '..', dir)
-}
-
-module.exports = {
- entry: {
- app: './src/main.js'
- },
- output: {
- path: config.build.assetsRoot,
- filename: '[name].js',
- publicPath: process.env.NODE_ENV !== 'development' ? config.build.assetsPublicPath : config.dev.assetsPublicPath
- },
- resolve: {
- extensions: ['.js', '.vue', '.json'],
- alias: {
- 'vue$': 'vue/dist/vue.esm.js',
- '@': resolve('src'),
- 'src': path.resolve(__dirname, '../src'),
- 'assets': path.resolve(__dirname, '../src/assets'),
- 'components': path.resolve(__dirname, '../src/components'),
- 'views': path.resolve(__dirname, '../src/views'),
- 'styles': path.resolve(__dirname, '../src/styles'),
- 'api': path.resolve(__dirname, '../src/api'),
- 'utils': path.resolve(__dirname, '../src/utils'),
- 'store': path.resolve(__dirname, '../src/store'),
- 'router': path.resolve(__dirname, '../src/router'),
- 'mock': path.resolve(__dirname, '../src/mock'),
- 'vendor': path.resolve(__dirname, '../src/vendor'),
- 'static': path.resolve(__dirname, '../static')
- }
- },
- module: {
- rules: [
- {
- test: /\.(js|vue)$/,
- loader: 'eslint-loader',
- enforce: "pre",
- include: [resolve('src'), resolve('test')],
- options: {
- formatter: require('eslint-friendly-formatter')
- }
- },
- {
- test: /\.vue$/,
- loader: 'vue-loader',
- options: vueLoaderConfig
- },
- {
- test: /\.js$/,
- loader: 'babel-loader?cacheDirectory',
- include: [resolve('src'), resolve('test')]
- },
- {
- test: /\.svg$/,
- loader: 'svg-sprite-loader',
- include: [resolve('src/icons')],
- options: {
- symbolId: 'icon-[name]'
- }
- },
- {
- test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
- loader: 'url-loader',
- exclude: [resolve('src/icons')],
- options: {
- limit: 10000,
- name: utils.assetsPath('img/[name].[hash:7].[ext]')
- }
- },
- {
- test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
- loader: 'url-loader',
- options: {
- limit: 10000,
- name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
- }
- }
- ]
- },
- //注入全局mixin
- // sassResources: path.join(__dirname, '../src/styles/mixin.scss'),
- // sassLoader: {
- // data: path.join(__dirname, '../src/styles/index.scss')
- // },
-}
-
diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js
deleted file mode 100644
index 5aec2fafc4f..00000000000
--- a/build/webpack.dev.conf.js
+++ /dev/null
@@ -1,46 +0,0 @@
-var utils = require('./utils')
-var path = require('path')
-var webpack = require('webpack')
-var config = require('../config')
-var merge = require('webpack-merge')
-var baseWebpackConfig = require('./webpack.base.conf')
-var HtmlWebpackPlugin = require('html-webpack-plugin')
-var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
-
-// add hot-reload related code to entry chunks
-Object.keys(baseWebpackConfig.entry).forEach(function (name) {
- baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name])
-})
-
-function resolveApp(relativePath) {
- return path.resolve(relativePath);
-}
-
-module.exports = merge(baseWebpackConfig, {
- module: {
- rules: utils.styleLoaders({
- sourceMap: config.dev.cssSourceMap
- })
- },
- // cheap-source-map is faster for development
- devtool: '#cheap-source-map',
- cache: true,
- plugins: [
- new webpack.DefinePlugin({
- 'process.env': config.dev.env
- }),
- // https://github.com/glenjamin/webpack-hot-middleware#installation--usage
- new webpack.HotModuleReplacementPlugin(),
- new webpack.NoEmitOnErrorsPlugin(),
- // https://github.com/ampedandwired/html-webpack-plugin
- new HtmlWebpackPlugin({
- filename: 'index.html',
- template: 'index.html',
- favicon: resolveApp('favicon.ico'),
- inject: true,
- path: config.dev.assetsPublicPath + config.dev.assetsSubDirectory
- }),
- new FriendlyErrorsPlugin()
- ]
-})
-
diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js
deleted file mode 100644
index 05f848741dd..00000000000
--- a/build/webpack.prod.conf.js
+++ /dev/null
@@ -1,117 +0,0 @@
-var path = require('path')
-var utils = require('./utils')
-var webpack = require('webpack')
-var config = require('../config')
-var merge = require('webpack-merge')
-var baseWebpackConfig = require('./webpack.base.conf')
-var CopyWebpackPlugin = require('copy-webpack-plugin')
-var HtmlWebpackPlugin = require('html-webpack-plugin')
-var ExtractTextPlugin = require('extract-text-webpack-plugin')
-var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
-
-var env = process.env.NODE_ENV === 'production' ? config.build.prodEnv : config.build.sitEnv
-
-function resolveApp(relativePath) {
- return path.resolve(relativePath);
-}
-
-var webpackConfig = merge(baseWebpackConfig, {
- module: {
- rules: utils.styleLoaders({
- sourceMap: config.build.productionSourceMap,
- extract: true
- })
- },
- devtool: config.build.productionSourceMap ? '#source-map' : false,
- output: {
- path: config.build.assetsRoot,
- filename: utils.assetsPath('js/[name].[chunkhash].js'),
- chunkFilename: utils.assetsPath('js/[id].[chunkhash].js'),
- publicPath: config.build.assetsPublicPath
- },
- plugins: [
- // http://vuejs.github.io/vue-loader/en/workflow/production.html
- new webpack.DefinePlugin({
- 'process.env': env
- }),
- new webpack.optimize.UglifyJsPlugin({
- compress: {
- warnings: false
- },
- sourceMap: true
- }),
- // extract css into its own file
- new ExtractTextPlugin({
- filename: utils.assetsPath('css/[name].[contenthash].css')
- }),
- // Compress extracted CSS. We are using this plugin so that possible
- // duplicated CSS from different components can be deduped.
- new OptimizeCSSPlugin(),
- // generate dist index.html with correct asset hash for caching.
- // you can customize output by editing /index.html
- // see https://github.com/ampedandwired/html-webpack-plugin
- new HtmlWebpackPlugin({
- filename: 'index.html',
- template: 'index.html',
- inject: true,
- favicon: resolveApp('favicon.ico'),
- minify: {
- removeComments: true,
- collapseWhitespace: true,
- removeRedundantAttributes: true,
- useShortDoctype: true,
- removeEmptyAttributes: true,
- removeStyleLinkTypeAttributes: true,
- keepClosingSlash: true,
- minifyJS: true,
- minifyCSS: true,
- minifyURLs: true
- },
- path: config.build.assetsPublicPath + config.build.assetsSubDirectory,
- // necessary to consistently work with multiple chunks via CommonsChunkPlugin
- chunksSortMode: 'dependency'
- }),
- // cache Module Identifiers
- new webpack.HashedModuleIdsPlugin(),
- // split vendor js into its own file
- new webpack.optimize.CommonsChunkPlugin({
- name: 'vendor',
- minChunks: function (module, count) {
- // any required modules inside node_modules are extracted to vendor
- return (
- module.resource &&
- /\.js$/.test(module.resource) &&
- module.resource.indexOf(
- path.join(__dirname, '../node_modules')
- ) === 0
- )
- }
- }),
- // split echarts into its own file
- new webpack.optimize.CommonsChunkPlugin({
- async: 'echarts',
- minChunks(module) {
- var context = module.context;
- return context && (context.indexOf('echarts') >= 0 || context.indexOf('zrender') >= 0);
- }
- }),
- // extract webpack runtime and module manifest to its own file in order to
- // prevent vendor hash from being updated whenever app bundle is updated
- new webpack.optimize.CommonsChunkPlugin({
- name: 'manifest',
- chunks: ['vendor']
- }),
- // copy custom static assets
- new CopyWebpackPlugin([{
- from: path.resolve(__dirname, '../static'),
- to: config.build.assetsSubDirectory,
- ignore: ['.*']
- }])
- ]
-})
-if (config.build.bundleAnalyzerReport) {
- var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
- webpackConfig.plugins.push(new BundleAnalyzerPlugin())
-}
-module.exports = webpackConfig
-
diff --git a/config/dev.env.js b/config/dev.env.js
deleted file mode 100644
index e26486cd886..00000000000
--- a/config/dev.env.js
+++ /dev/null
@@ -1,5 +0,0 @@
-module.exports = {
- NODE_ENV: '"development"',
- BASE_API: '"https://api-dev/"',
- APP_ORIGIN: '"https://wallstreetcn.com/"'
-}
diff --git a/config/index.js b/config/index.js
deleted file mode 100644
index 581d53a33f8..00000000000
--- a/config/index.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// see http://vuejs-templates.github.io/webpack for documentation.
-var path = require('path')
-
-module.exports = {
- build: {
- sitEnv: require('./sit.env'),
- prodEnv: require('./prod.env'),
- index: path.resolve(__dirname, '../dist/index.html'),
- assetsRoot: path.resolve(__dirname, '../dist'),
- assetsSubDirectory: 'static',
- assetsPublicPath: './', //请根据自己路径配置更改
- productionSourceMap: false,
- // Gzip off by default as many popular static hosts such as
- // Surge or Netlify already gzip all static assets for you.
- // Before setting to `true`, make sure to:
- // npm install --save-dev compression-webpack-plugin
- productionGzip: false,
- productionGzipExtensions: ['js', 'css'],
- // Run the build command with an extra argument to
- // View the bundle analyzer report after build finishes:
- // `npm run build --report`
- // Set to `true` or `false` to always turn it on or off
- bundleAnalyzerReport: process.env.npm_config_report
- },
- dev: {
- env: require('./dev.env'),
- port: 9527,
- autoOpenBrowser: true,
- assetsSubDirectory: 'static',
- assetsPublicPath: '/',
- proxyTable: {},
- // CSS Sourcemaps off by default because relative paths are "buggy"
- // with this option, according to the CSS-Loader README
- // (https://github.com/webpack/css-loader#sourcemaps)
- // In our experience, they generally work as expected,
- // just be aware of this issue when enabling this option.
- cssSourceMap: false
- }
-}
diff --git a/config/prod.env.js b/config/prod.env.js
deleted file mode 100644
index cc935b9a948..00000000000
--- a/config/prod.env.js
+++ /dev/null
@@ -1,5 +0,0 @@
-module.exports = {
- NODE_ENV: '"production"',
- BASE_API: '"https://api-prod/"',
- APP_ORIGIN: '"https://wallstreetcn.com/"'
-};
diff --git a/config/sit.env.js b/config/sit.env.js
deleted file mode 100644
index 64cf403b9ae..00000000000
--- a/config/sit.env.js
+++ /dev/null
@@ -1,5 +0,0 @@
-module.exports = {
- NODE_ENV: '"production"',
- BASE_API: '"https://api-sit/"',
- APP_ORIGIN: '"https://wallstreetcn.com/"'
-};
diff --git a/favicon.ico b/favicon.ico
deleted file mode 100644
index 7cd39d7fc1b..00000000000
Binary files a/favicon.ico and /dev/null differ
diff --git a/gifs/2login.gif b/gifs/2login.gif
deleted file mode 100644
index 4b2b64da6a8..00000000000
Binary files a/gifs/2login.gif and /dev/null differ
diff --git a/gifs/dynamictable.gif b/gifs/dynamictable.gif
deleted file mode 100644
index ca666e53a7d..00000000000
Binary files a/gifs/dynamictable.gif and /dev/null differ
diff --git a/gifs/echarts.gif b/gifs/echarts.gif
deleted file mode 100644
index 11ad2a56e07..00000000000
Binary files a/gifs/echarts.gif and /dev/null differ
diff --git a/gifs/editor.gif b/gifs/editor.gif
deleted file mode 100644
index 1ebb9c6c152..00000000000
Binary files a/gifs/editor.gif and /dev/null differ
diff --git a/gifs/errorlog.gif b/gifs/errorlog.gif
deleted file mode 100644
index d37c7085036..00000000000
Binary files a/gifs/errorlog.gif and /dev/null differ
diff --git a/gifs/excel.png b/gifs/excel.png
deleted file mode 100644
index e536774c35f..00000000000
Binary files a/gifs/excel.png and /dev/null differ
diff --git a/gifs/leftmenu.gif b/gifs/leftmenu.gif
deleted file mode 100644
index f3ca2bd961b..00000000000
Binary files a/gifs/leftmenu.gif and /dev/null differ
diff --git a/gifs/login.png b/gifs/login.png
deleted file mode 100644
index a923b271fe6..00000000000
Binary files a/gifs/login.png and /dev/null differ
diff --git a/gifs/order.gif b/gifs/order.gif
deleted file mode 100644
index d038b06d2aa..00000000000
Binary files a/gifs/order.gif and /dev/null differ
diff --git a/gifs/table.gif b/gifs/table.gif
deleted file mode 100644
index 31dcd1443e8..00000000000
Binary files a/gifs/table.gif and /dev/null differ
diff --git a/gifs/tabs.gif b/gifs/tabs.gif
deleted file mode 100644
index 331d192fa44..00000000000
Binary files a/gifs/tabs.gif and /dev/null differ
diff --git a/gifs/theme.gif b/gifs/theme.gif
deleted file mode 100644
index 47f48d54c74..00000000000
Binary files a/gifs/theme.gif and /dev/null differ
diff --git a/gifs/upload1.gif b/gifs/upload1.gif
deleted file mode 100644
index 37a5db22368..00000000000
Binary files a/gifs/upload1.gif and /dev/null differ
diff --git a/gifs/uploadAvatar.gif b/gifs/uploadAvatar.gif
deleted file mode 100644
index c689b9a23b6..00000000000
Binary files a/gifs/uploadAvatar.gif and /dev/null differ
diff --git a/jest.config.js b/jest.config.js
new file mode 100644
index 00000000000..143cdc868cb
--- /dev/null
+++ b/jest.config.js
@@ -0,0 +1,24 @@
+module.exports = {
+ moduleFileExtensions: ['js', 'jsx', 'json', 'vue'],
+ transform: {
+ '^.+\\.vue$': 'vue-jest',
+ '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$':
+ 'jest-transform-stub',
+ '^.+\\.jsx?$': 'babel-jest'
+ },
+ moduleNameMapper: {
+ '^@/(.*)$': 'I am testing data, I am testing data.