diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 00000000..d5408027
--- /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/question.md b/.github/ISSUE_TEMPLATE/question.md
index 96be4532..76083546 100755
--- a/.github/ISSUE_TEMPLATE/question.md
+++ b/.github/ISSUE_TEMPLATE/question.md
@@ -12,3 +12,24 @@ about: Asking questions about use
Before asking a question, please make sure that you have tried your best to solve this problem.
If it's a code-related issue, please don't just take screenshots. Please provide an online demo to save each other's time.
-->
+
+#### Steps to reproduce(问题复现步骤)
+
+
+#### Screenshot or Gif(截图或动态图)
+
+
+#### Link to minimal reproduction(最小可在线还原demo)
+
+
+
+#### Other relevant information(格外信息)
+- Your OS:
+- Node.js version:
+- vue-element-admin version:
diff --git a/.postcssrc.js b/.postcssrc.js
deleted file mode 100644
index 09948d63..00000000
--- 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 "browserslist" field in package.json
- "autoprefixer": {}
- }
-}
diff --git a/README.es.md b/README.es.md
new file mode 100644
index 00000000..734c51c2
--- /dev/null
+++ b/README.es.md
@@ -0,0 +1,216 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Español | [English](./README.md) | [简体中文](./README.zh-CN.md) | [日本語](./README.ja.md)
+
+## Introducción
+
+[vue-element-admin](https://panjiachen.github.io/vue-element-admin) es una interfáz de administración preparada para producción. Está basada en [vue](https://github.com/vuejs/vue) y usa [element-ui](https://github.com/ElemeFE/element) como conjunto de herramientas de interfáz de usuario.
+
+Vue Element Admin es una solución práctica basada en la nueva plataforma de desarrollo de vue, construida con soporte a i18 para el manejo de múltiples lenguajes, plantillas estándares para aplicaciones de negocio y un conjunto de asombrosas características. Esta herramienta ayuda a construir largas y complejas Aplicacones de una sola página (SPA). Creo que lo que necesites hacer, este proyecto te ayudará.
+
+- [Vista Prévia de la Aplicación](https://panjiachen.github.io/vue-element-admin)
+
+- [Documentación](https://panjiachen.github.io/vue-element-admin-site/)
+
+- [Canal de Gitter](https://gitter.im/vue-element-admin/discuss)
+
+- [Para Donaciones](https://panjiachen.github.io/vue-element-admin-site/donate/)
+
+- [Enlace de Wiki](https://github.com/PanJiaChen/vue-element-admin/wiki)
+
+- [Canal de Gitee](https://panjiachen.gitee.io/vue-element-admin/)
+
+- Plantilla base recomendada para usar: [vue-admin-template](https://github.com/PanJiaChen/vue-admin-template)
+- Aplicación de Escritorio: [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
+- Plantilla de Typescript: [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (Créditos: [@Armour](https://github.com/Armour))
+
+**Después de la versión `v4.1.0+`, la rama por defecto master no tendrá soporte para i18n. Por favor use [i18n](https://github.com/PanJiaChen/vue-element-admin/tree/i18n), los cambios serán incluidos en la rama master**
+
+**la versión actual es `v4.0+` construida con `vue-cli`. Si encuentra algún problema, por favor coloque un [issue](https://github.com/PanJiaChen/vue-element-admin/issues/new). Si desea usar la versión anterior, puede cambiar de rama a [tag/3.11.0](https://github.com/PanJiaChen/vue-element-admin/tree/tag/3.11.0), no relacionado con `vue-cli`**
+
+**Este proyecto no está soportado para versiones muy viejas de navegadores (e.g. IE).**
+
+## Preparación
+
+Necesita instalar [node](https://nodejs.org/) y [git](https://git-scm.com/) localmente. El proyecto es basado en [ES2015+](https://es6.ruanyifeng.com/), [vue](https://cn.vuejs.org/index.html), [vuex](https://vuex.vuejs.org/zh-cn/), [vue-router](https://router.vuejs.org/zh-cn/), [vue-cli](https://github.com/vuejs/vue-cli) , [axios](https://github.com/axios/axios) and [element-ui](https://github.com/ElemeFE/element), toda la solicitud de datos simulada se realiza a través de [Mock.js](https://github.com/nuysoft/Mock).
+Entendiendo y aprendiendo esto pudiera ayudarle con su proyecto.
+
+
+
+
+
+## Patrocinantes
+
+Se un patrocinante y pon tu logo en nuestro README on GitHub con un enlace directo a tu sitio web. [[Se un Patrocinante]](https://www.patreon.com/panjiachen)
+
+
Plantilla de Dashboard de administración hecha con Vue, React y Angular.
+
+## Características
+
+```
+- Iniciar / Cerrar Sesión
+
+- Permisos de Authentication
+ - Página de Permisos
+ - Directivas de permisos
+ - Página de configuración de permisos
+ - Autenticación por dos pasos
+
+- Construcción Multi-entorno
+ - dev sit stage producción
+
+- Características Globales
+ - I18n
+ - Temas dinámicos
+ - Dynamic sidebar (soporte a rutas multi-nivel)
+ - Barra de rutas dinámica
+ - Tags-view (Tab page Support right-click operation)
+ - Svg Sprite
+ - Datos de simulación con Mock
+ - Pantalla completa
+ - Responsive Sidebar
+
+- 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
index d4ffcace..7b1232bc 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -26,7 +26,7 @@
-日本語 | [English](./README.md) | [简体中文](./README.zh-CN.md)
+日本語 | [English](./README.md) | [简体中文](./README.zh-CN.md) | [Spanish](./README.es.md)
## 概要
diff --git a/README.md b/README.md
index e6ade124..3a2b6191 100644
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@
-English | [简体中文](./README.zh-CN.md) | [日本語](./README.ja.md)
+English | [简体中文](./README.zh-CN.md) | [日本語](./README.ja.md) | [Spanish](./README.es.md)
## Introduction
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 5bb313ce..31bbe351 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -26,7 +26,7 @@
-简体中文 | [English](./README.md)
+简体中文 | [English](./README.md) | [日本語](./README.ja.md) | [Spanish](./README.es.md)
## 简介
@@ -68,6 +68,7 @@
- [手摸手,带你用 vue 撸后台 系列二(登录权限篇)](https://juejin.im/post/591aa14f570c35006961acac)
- [手摸手,带你用 vue 撸后台 系列三 (实战篇)](https://juejin.im/post/593121aa0ce4630057f70d35)
- [手摸手,带你用 vue 撸后台 系列四(vueAdmin 一个极简的后台基础模板)](https://juejin.im/post/595b4d776fb9a06bbe7dba56)
+- [手摸手,带你用vue撸后台 系列五(v4.0新版本)](https://juejin.im/post/5c92ff94f265da6128275a85)
- [手摸手,带你封装一个 vue component](https://segmentfault.com/a/1190000009090836)
- [手摸手,带你优雅的使用 icon](https://juejin.im/post/59bb864b5188257e7a427c09)
- [手摸手,带你用合理的姿势使用 webpack4(上)](https://juejin.im/post/5b56909a518825195f499806)
diff --git a/package.json b/package.json
index c9cde7ba..8fbbf88e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "vue-element-admin",
- "version": "4.1.0",
+ "version": "4.2.1",
"description": "A magical vue admin. An out-of-box UI solution for enterprise applications. Newest development stack of vue. Lots of awesome features",
"author": "Pan ",
"license": "MIT",
@@ -78,6 +78,7 @@
"@vue/cli-plugin-unit-jest": "3.5.3",
"@vue/cli-service": "3.5.3",
"@vue/test-utils": "1.0.0-beta.29",
+ "autoprefixer": "^9.5.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.0.1",
"babel-jest": "23.6.0",
@@ -107,7 +108,6 @@
},
"browserslist": [
"> 1%",
- "last 2 versions",
- "not ie <= 8"
+ "last 2 versions"
]
}
diff --git a/postcss.config.js b/postcss.config.js
new file mode 100644
index 00000000..961986e2
--- /dev/null
+++ b/postcss.config.js
@@ -0,0 +1,5 @@
+module.exports = {
+ plugins: {
+ autoprefixer: {}
+ }
+}
diff --git a/public/index.html b/public/index.html
index 9bb2d7fc..e9185009 100644
--- a/public/index.html
+++ b/public/index.html
@@ -9,10 +9,6 @@
<%= webpackConfig.name %>
-
- <% for(var js of htmlWebpackPlugin.options.cdn.js) { %>
-
- <% } %>
diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue
index 29f9a04c..e224ff73 100644
--- a/src/components/Breadcrumb/index.vue
+++ b/src/components/Breadcrumb/index.vue
@@ -19,7 +19,11 @@ export default {
}
},
watch: {
- $route() {
+ $route(route) {
+ // if you go to the redirect page, do not update the breadcrumbs
+ if (route.path.startsWith('/redirect/')) {
+ return
+ }
this.getBreadcrumb()
}
},
diff --git a/src/components/ErrorLog/index.vue b/src/components/ErrorLog/index.vue
index 7ffa573b..6119c037 100644
--- a/src/components/ErrorLog/index.vue
+++ b/src/components/ErrorLog/index.vue
@@ -6,7 +6,11 @@
-
+
+
+ Error Log
+ Clear All
+
@@ -54,6 +58,12 @@ export default {
errorLogs() {
return this.$store.getters.errorLogs
}
+ },
+ methods: {
+ clearAll() {
+ this.dialogTableVisible = false
+ this.$store.dispatch('errorLog/clearErrorLog')
+ }
}
}
diff --git a/src/components/RightPanel/index.vue b/src/components/RightPanel/index.vue
index 63408d8b..55e8c1e5 100644
--- a/src/components/RightPanel/index.vue
+++ b/src/components/RightPanel/index.vue
@@ -86,32 +86,27 @@ export default {
diff --git a/src/components/Tinymce/dynamicLoadScript.js b/src/components/Tinymce/dynamicLoadScript.js
new file mode 100644
index 00000000..185f58dc
--- /dev/null
+++ b/src/components/Tinymce/dynamicLoadScript.js
@@ -0,0 +1,59 @@
+let callbacks = []
+
+function loadedTinymce() {
+ // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2144
+ // check is successfully downloaded script
+ return window.tinymce
+}
+
+const dynamicLoadScript = (src, callback) => {
+ const existingScript = document.getElementById(src)
+ const cb = callback || function() {}
+
+ if (!existingScript) {
+ const script = document.createElement('script')
+ script.src = src // src url for the third-party library being loaded.
+ script.id = src
+ document.body.appendChild(script)
+ callbacks.push(cb)
+ const onEnd = 'onload' in script ? stdOnEnd : ieOnEnd
+ onEnd(script)
+ }
+
+ if (existingScript && cb) {
+ if (loadedTinymce()) {
+ cb(null, existingScript)
+ } else {
+ callbacks.push(cb)
+ }
+ }
+
+ function stdOnEnd(script) {
+ script.onload = function() {
+ // this.onload = null here is necessary
+ // because even IE9 works not like others
+ this.onerror = this.onload = null
+ for (const cb of callbacks) {
+ cb(null, script)
+ }
+ callbacks = null
+ }
+ script.onerror = function() {
+ this.onerror = this.onload = null
+ cb(new Error('Failed to load ' + src), script)
+ }
+ }
+
+ function ieOnEnd(script) {
+ script.onreadystatechange = function() {
+ if (this.readyState !== 'complete' && this.readyState !== 'loaded') return
+ this.onreadystatechange = null
+ for (const cb of callbacks) {
+ cb(null, script) // there is no way to catch loading errors in IE8
+ }
+ callbacks = null
+ }
+ }
+}
+
+export default dynamicLoadScript
diff --git a/src/components/Tinymce/index.vue b/src/components/Tinymce/index.vue
index 62cb2c06..0c6174c4 100644
--- a/src/components/Tinymce/index.vue
+++ b/src/components/Tinymce/index.vue
@@ -15,6 +15,10 @@
import editorImage from './components/EditorImage'
import plugins from './plugins'
import toolbar from './toolbar'
+import load from './dynamicLoadScript'
+
+// why use this cdn, detail see https://github.com/PanJiaChen/tinymce-all-in-one
+const tinymceCDN = 'https://cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.3/tinymce.min.js'
export default {
name: 'Tinymce',
@@ -60,7 +64,9 @@ export default {
fullscreen: false,
languageTypeList: {
'en': 'en',
- 'zh': 'zh_CN'
+ 'zh': 'zh_CN',
+ 'es': 'es_MX',
+ 'ja': 'ja'
}
}
},
@@ -82,10 +88,12 @@ export default {
}
},
mounted() {
- this.initTinymce()
+ this.init()
},
activated() {
- this.initTinymce()
+ if (window.tinymce) {
+ this.initTinymce()
+ }
},
deactivated() {
this.destroyTinymce()
@@ -94,10 +102,21 @@ export default {
this.destroyTinymce()
},
methods: {
+ init() {
+ // dynamic load tinymce from cdn
+ load(tinymceCDN, (err) => {
+ if (err) {
+ this.$message.error(err.message)
+ return
+ }
+ this.initTinymce()
+ })
+ },
initTinymce() {
const _this = this
window.tinymce.init({
selector: `#${this.tinymceId}`,
+ language: this.languageTypeList['en'],
height: this.height,
body_class: 'panel-body ',
object_resizing: false,
diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue
index e72e4555..a8976380 100644
--- a/src/layout/components/AppMain.vue
+++ b/src/layout/components/AppMain.vue
@@ -16,7 +16,7 @@ export default {
return this.$store.state.tagsView.cachedViews
},
key() {
- return this.$route.fullPath
+ return this.$route.path
}
}
}
@@ -33,8 +33,6 @@ export default {
.fixed-header+.app-main {
padding-top: 50px;
- height: 100vh;
- overflow: auto;
}
.hasTagsView {
@@ -49,3 +47,11 @@ export default {
}
+
diff --git a/src/main.js b/src/main.js
index 205b3c84..ef07f389 100644
--- a/src/main.js
+++ b/src/main.js
@@ -21,12 +21,16 @@ import * as filters from './filters' // global filters
/**
* If you don't want to use mock-server
- * you want to use mockjs for request interception
- * you can execute:
+ * you want to use MockJs for mock api
+ * you can execute: mockXHR()
*
- * import { mockXHR } from '../mock'
- * mockXHR()
+ * Currently MockJs will be used in the production environment,
+ * please remove it before going online! ! !
*/
+import { mockXHR } from '../mock'
+if (process.env.NODE_ENV === 'production') {
+ mockXHR()
+}
Vue.use(Element, {
size: Cookies.get('size') || 'medium' // set element-ui default size
diff --git a/src/store/index.js b/src/store/index.js
index 70736d3a..0fd83955 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -5,7 +5,7 @@ import getters from './getters'
Vue.use(Vuex)
// https://webpack.js.org/guides/dependency-management/#requirecontext
-const modulesFiles = require.context('./modules', false, /\.js$/)
+const modulesFiles = require.context('./modules', true, /\.js$/)
// you do not need `import app from './modules/app'`
// it will auto require all vuex module from modules file
diff --git a/src/store/modules/errorLog.js b/src/store/modules/errorLog.js
index 8e3db060..6b01f957 100644
--- a/src/store/modules/errorLog.js
+++ b/src/store/modules/errorLog.js
@@ -5,12 +5,18 @@ const state = {
const mutations = {
ADD_ERROR_LOG: (state, log) => {
state.logs.push(log)
+ },
+ CLEAR_ERROR_LOG: (state) => {
+ state.logs.splice(0)
}
}
const actions = {
addErrorLog({ commit }, log) {
commit('ADD_ERROR_LOG', log)
+ },
+ clearErrorLog({ commit }) {
+ commit('CLEAR_ERROR_LOG')
}
}
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index d2b2e67a..dbc29003 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -115,6 +115,9 @@ const actions = {
// dynamically add accessible routes
router.addRoutes(accessRoutes)
+ // reset visited views and cached views
+ dispatch('tagsView/delAllViews', null, { root: true })
+
resolve()
})
}
diff --git a/src/styles/sidebar.scss b/src/styles/sidebar.scss
index e55f8656..3dad4c39 100644
--- a/src/styles/sidebar.scss
+++ b/src/styles/sidebar.scss
@@ -95,10 +95,6 @@
margin-left: 54px;
}
- .svg-icon {
- margin-right: 0px;
- }
-
.submenu-title-noDropdown {
padding: 0 !important;
position: relative;
diff --git a/src/utils/request.js b/src/utils/request.js
index bc346a8c..71d5ea4b 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -48,7 +48,7 @@ service.interceptors.response.use(
// if the custom code is not 20000, it is judged as an error.
if (res.code !== 20000) {
Message({
- message: res.message || 'error',
+ message: res.message || 'Error',
type: 'error',
duration: 5 * 1000
})
@@ -66,7 +66,7 @@ service.interceptors.response.use(
})
})
}
- return Promise.reject(res.message || 'error')
+ return Promise.reject(new Error(res.message || 'Error'))
} else {
return res
}
diff --git a/src/views/components-demo/mixin.vue b/src/views/components-demo/mixin.vue
index 19b7a543..c64a073a 100644
--- a/src/views/components-demo/mixin.vue
+++ b/src/views/components-demo/mixin.vue
@@ -149,6 +149,7 @@ export default {
{ title: '登录权限篇', href: 'https://juejin.im/post/591aa14f570c35006961acac' },
{ title: '实战篇', href: 'https://juejin.im/post/593121aa0ce4630057f70d35' },
{ title: 'vue-admin-template 篇', href: 'https://juejin.im/post/595b4d776fb9a06bbe7dba56' },
+ { title: 'v4.0 篇', href: 'https://juejin.im/post/5c92ff94f265da6128275a85' },
{ title: '优雅的使用 icon', href: 'https://juejin.im/post/59bb864b5188257e7a427c09' }
]
}
diff --git a/src/views/dashboard/admin/components/BarChart.vue b/src/views/dashboard/admin/components/BarChart.vue
index fa265ef6..be0af34f 100644
--- a/src/views/dashboard/admin/components/BarChart.vue
+++ b/src/views/dashboard/admin/components/BarChart.vue
@@ -5,11 +5,12 @@