From a284c1f00738ecfa93c5550a8f87fb6925cc1c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C3=B3n=20Menor?= Date: Mon, 15 Oct 2018 04:10:50 +0200 Subject: [PATCH 01/22] feature: support Spanish(#1196) --- src/components/LangSelect/index.vue | 1 + src/lang/es.js | 155 ++++++++++++++++++++++++++++ src/lang/index.js | 8 +- src/views/i18n-demo/index.vue | 2 + src/views/i18n-demo/local.js | 20 ++++ 5 files changed, 185 insertions(+), 1 deletion(-) create mode 100755 src/lang/es.js diff --git a/src/components/LangSelect/index.vue b/src/components/LangSelect/index.vue index 31cc80d0..ef5f2c44 100644 --- a/src/components/LangSelect/index.vue +++ b/src/components/LangSelect/index.vue @@ -6,6 +6,7 @@ 中文 English + Español diff --git a/src/lang/es.js b/src/lang/es.js new file mode 100755 index 00000000..19171904 --- /dev/null +++ b/src/lang/es.js @@ -0,0 +1,155 @@ +export default { + route: { + dashboard: 'Panel de control', + introduction: 'Introducción', + documentation: 'Documentación', + guide: 'Guía', + permission: 'Permisos', + pagePermission: 'Permisos de la página', + directivePermission: 'Permisos de la directiva', + icons: 'Iconos', + components: 'Componentes', + componentIndex: 'Introducción', + tinymce: 'Tinymce', + markdown: 'Markdown', + jsonEditor: 'Editor JSON', + dndList: 'Lista Dnd', + splitPane: 'Panel dividido', + avatarUpload: 'Subir avatar', + dropzone: 'Subir ficheros', + sticky: 'Sticky', + countTo: 'CountTo', + componentMixin: 'Mixin', + backToTop: 'Ir arriba', + dragDialog: 'Drag Dialog', + dragKanban: 'Drag Kanban', + charts: 'Gráficos', + keyboardChart: 'Keyboard Chart', + lineChart: 'Gráfico de líneas', + mixChart: 'Mix Chart', + example: 'Ejemplo', + nested: 'Rutas anidadass', + menu1: 'Menu 1', + 'menu1-1': 'Menu 1-1', + 'menu1-2': 'Menu 1-2', + 'menu1-2-1': 'Menu 1-2-1', + 'menu1-2-2': 'Menu 1-2-2', + 'menu1-3': 'Menu 1-3', + menu2: 'Menu 2', + Table: 'Tabla', + dynamicTable: 'Tabla dinámica', + dragTable: 'Arrastrar tabla', + inlineEditTable: 'Editor', + complexTable: 'Complex Table', + treeTable: 'Tree Table', + customTreeTable: 'Custom TreeTable', + tab: 'Pestaña', + form: 'Formulario', + createArticle: 'Crear artículo', + editArticle: 'Editar artículo', + articleList: 'Listado de artículos', + errorPages: 'Páginas de error', + page401: '401', + page404: '404', + errorLog: 'Registro de errores', + excel: 'Excel', + exportExcel: 'Exportar a Excel', + selectExcel: 'Export seleccionado', + uploadExcel: 'Subir Excel', + zip: 'Zip', + exportZip: 'Exportar a Zip', + theme: 'Tema', + clipboardDemo: 'Clipboard', + i18n: 'I18n', + externalLink: 'Enlace externo' + }, + navbar: { + logOut: 'Salir', + dashboard: 'Panel de control', + github: 'Github', + screenfull: 'Pantalla completa', + theme: 'Tema', + size: 'Tamaño global' + }, + login: { + title: 'Formulario de acceso', + logIn: 'Acceso', + username: 'Usuario', + password: 'Contraseña', + any: 'nada', + thirdparty: 'Conectar con', + thirdpartyTips: 'No se puede simular en local, así que combine su propia simulación de negocios. ! !' + }, + documentation: { + documentation: 'Documentación', + github: 'Repositorio Github' + }, + permission: { + roles: 'Tus permisos', + switchRoles: 'Cambiar permisos' + }, + guide: { + description: 'The guide page is useful for some people who entered the project for the first time. You can briefly introduce the features of the project. Demo is based on ', + button: 'Ver guía' + }, + components: { + documentation: 'Documentación', + tinymceTips: 'Rich text editor is a core part of management system, but at the same time is a place with lots of problems. In the process of selecting rich texts, I also walked a lot of detours. The common rich text editors in the market are basically used, and the finally chose Tinymce. See documentation for more detailed rich text editor comparisons and introductions.', + dropzoneTips: 'Because my business has special needs, and has to upload images to qiniu, so instead of a third party, I chose encapsulate it by myself. It is very simple, you can see the detail code in @/components/Dropzone.', + stickyTips: 'when the page is scrolled to the preset position will be sticky on the top.', + backToTopTips1: 'When the page is scrolled to the specified position, the Back to Top button appears in the lower right corner', + backToTopTips2: 'You can customize the style of the button, show / hide, height of appearance, height of the return. If you need a text prompt, you can use element-ui el-tooltip elements externally', + imageUploadTips: 'Since I was using only the vue@1 version, and it is not compatible with mockjs at the moment, I modified it myself, and if you are going to use it, it is better to use official version.' + }, + table: { + dynamicTips1: 'Fixed header, sorted by header order', + dynamicTips2: 'Not fixed header, sorted by click order', + dragTips1: 'Orden por defecto', + dragTips2: 'The after dragging order', + title: 'Título', + importance: 'Importancia', + type: 'Tipo', + remark: 'Remark', + search: 'Buscar', + add: 'Añadir', + export: 'Exportar', + reviewer: 'reviewer', + id: 'ID', + date: 'Fecha', + author: 'Autor', + readings: 'Lector', + status: 'Estado', + actions: 'Acciones', + edit: 'Editar', + publish: 'Publicar', + draft: 'Draft', + delete: 'Eliminar', + cancel: 'Cancelar', + confirm: 'Confirmar' + }, + errorLog: { + tips: 'Please click the bug icon in the upper right corner', + description: 'Now the management system are basically the form of the spa, it enhances the user experience, but it also increases the possibility of page problems, a small negligence may lead to the entire page deadlock. Fortunately Vue provides a way to catch handling exceptions, where you can handle errors or report exceptions.', + documentation: 'Documento de introducción' + }, + excel: { + export: 'Exportar', + selectedExport: 'Exportar seleccionados', + placeholder: 'Por favor escribe un nombre de fichero' + }, + zip: { + export: 'Exportar', + placeholder: 'Por favor escribe un nombre de fichero' + }, + theme: { + change: 'Cambiar tema', + documentation: 'Documentación del tema', + tips: 'Tips: It is different from the theme-pick on the navbar is two different skinning methods, each with different application scenarios. Refer to the documentation for details.' + }, + tagsView: { + refresh: 'Actualizar', + close: 'Cerrar', + closeOthers: 'Cerrar otros', + closeAll: 'Cerrar todos' + } +} diff --git a/src/lang/index.js b/src/lang/index.js index a77b07ea..7c9c8af6 100644 --- a/src/lang/index.js +++ b/src/lang/index.js @@ -3,8 +3,10 @@ import VueI18n from 'vue-i18n' import Cookies from 'js-cookie' import elementEnLocale from 'element-ui/lib/locale/lang/en' // element-ui lang import elementZhLocale from 'element-ui/lib/locale/lang/zh-CN'// element-ui lang +import elementEsLocale from 'element-ui/lib/locale/lang/es'// element-ui lang import enLocale from './en' import zhLocale from './zh' +import esLocale from './es' Vue.use(VueI18n) @@ -16,12 +18,16 @@ const messages = { zh: { ...zhLocale, ...elementZhLocale + }, + es: { + ...esLocale, + ...elementEsLocale } } const i18n = new VueI18n({ // set locale - // options: en or zh + // options: en | zh | es locale: Cookies.get('language') || 'en', // set locale messages messages diff --git a/src/views/i18n-demo/index.vue b/src/views/i18n-demo/index.vue index 94d1e470..b5344c67 100644 --- a/src/views/i18n-demo/index.vue +++ b/src/views/i18n-demo/index.vue @@ -9,6 +9,7 @@ 简体中文 English + Español {{ $t('i18nView.note') }} @@ -101,6 +102,7 @@ export default { if (!this.$i18n.getLocaleMessage('en')[viewName]) { this.$i18n.mergeLocaleMessage('en', local.en) this.$i18n.mergeLocaleMessage('zh', local.zh) + this.$i18n.mergeLocaleMessage('es', local.es) } this.setOptions() // set default select options }, diff --git a/src/views/i18n-demo/local.js b/src/views/i18n-demo/local.js index 1c39608e..9b43e605 100644 --- a/src/views/i18n-demo/local.js +++ b/src/views/i18n-demo/local.js @@ -39,5 +39,25 @@ export default { two: 'Two', three: 'Three' } + }, + es: { + i18nView: { + title: 'Switch Language', + note: 'The internationalization of this project is based on vue-i18n', + datePlaceholder: 'Pick a day', + selectPlaceholder: 'Select', + tableDate: 'tableDate', + tableName: 'tableName', + tableAddress: 'tableAddress', + default: 'default:', + primary: 'primary', + success: 'success', + info: 'info', + warning: 'warning', + danger: 'danger', + one: 'One', + two: 'Two', + three: 'Three' + } } } From e8ab82c2c103aa3a45712fb2794050b5b32b4140 Mon Sep 17 00:00:00 2001 From: CNine Date: Mon, 15 Oct 2018 13:13:21 +0800 Subject: [PATCH 02/22] fix[MockJS]: fix bug with withCredentials after using mockjs (#1194) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修复 Mock 导致请求丢失 Cookie 的问题 修复 Mock 导致 Cookie 丢失的问题,只有在 XHR.open() 周期时,自定义的 withCredentials 会被挂载,此时检查是否是未被拦截的 xhr,并挂载自定义的 withCredentials ,无则默认为 false --- src/mock/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mock/index.js b/src/mock/index.js index e6644ae1..3e00e918 100644 --- a/src/mock/index.js +++ b/src/mock/index.js @@ -4,6 +4,16 @@ import articleAPI from './article' import remoteSearchAPI from './remoteSearch' import transactionAPI from './transaction' +// 修复在使用 MockJS 情况下,设置 withCredentials = true,且未被拦截的跨域请求丢失 Cookies 的问题 +// https://github.com/nuysoft/Mock/issues/300 +Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send +Mock.XHR.prototype.send = function() { + if (this.custom.xhr) { + this.custom.xhr.withCredentials = this.withCredentials || false + } + this.proxy_send(...arguments) +} + // Mock.setup({ // timeout: '350-600' // }) From 0f6d830c1912b3e9374f23f6c674960632e5b4a3 Mon Sep 17 00:00:00 2001 From: Pan Date: Mon, 15 Oct 2018 17:21:17 +0800 Subject: [PATCH 03/22] update readme --- README.md | 8 ++++++++ README.zh-CN.md | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index ed083293..6a37ec93 100644 --- a/README.md +++ b/README.md @@ -198,6 +198,14 @@ If you find this project useful, you can buy author a glass of juice :tropical_d [Buy me a coffee](https://www.buymeacoffee.com/Pan) +## Browsers support + +Modern browsers and Internet Explorer 10+. + +| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | +| --------- | --------- | --------- | --------- | +| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions + ## License [MIT](https://github.com/PanJiaChen/vue-element-admin/blob/master/LICENSE) diff --git a/README.zh-CN.md b/README.zh-CN.md index ccd136e7..c7d4efbb 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -210,6 +210,14 @@ Detailed changes for each release are documented in the [release notes](https:// [Paypal Me](https://www.paypal.me/panfree23) +## Browsers support + +Modern browsers and Internet Explorer 10+. + +| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | +| --------- | --------- | --------- | --------- | +| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions + ## License [MIT](https://github.com/PanJiaChen/vue-element-admin/blob/master/LICENSE) From 96bda5515c21750f72a233e0141c5eae4f98875b Mon Sep 17 00:00:00 2001 From: frank10000 <740427741@qq.com> Date: Tue, 16 Oct 2018 10:56:01 +0800 Subject: [PATCH 04/22] perf[tagsView]: refactor the moveToTarget function (#1195) * fix[tagsView]:fixed visited view move to currentTag * edit the scroll regular friendly * tweak --- src/components/ScrollPane/index.vue | 54 ++++++++++++++++++++---- src/views/layout/components/TagsView.vue | 4 +- 2 files changed, 47 insertions(+), 11 deletions(-) diff --git a/src/components/ScrollPane/index.vue b/src/components/ScrollPane/index.vue index d4d75aee..89998e80 100644 --- a/src/components/ScrollPane/index.vue +++ b/src/components/ScrollPane/index.vue @@ -5,7 +5,7 @@ + + diff --git a/src/utils/index.js b/src/utils/index.js index 3af8b29b..0445827b 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -164,17 +164,6 @@ export function objectMerge(target, source) { return target } -export function scrollTo(element, to, duration) { - if (duration <= 0) return - const difference = to - element.scrollTop - const perTick = (difference / duration) * 10 - setTimeout(() => { - element.scrollTop = element.scrollTop + perTick - if (element.scrollTop === to) return - scrollTo(element, to, duration - 10) - }, 10) -} - export function toggleClass(element, className) { if (!element || !className) { return diff --git a/src/utils/scrollTo.js b/src/utils/scrollTo.js new file mode 100644 index 00000000..8affede6 --- /dev/null +++ b/src/utils/scrollTo.js @@ -0,0 +1,50 @@ +Math.easeInOutQuad = function(t, b, c, d) { + t /= d / 2 + if (t < 1) { + return c / 2 * t * t + b + } + t-- + return -c / 2 * (t * (t - 2) - 1) + b +} + +// requestAnimationFrame for Smart Animating http://goo.gl/sx5sts +var requestAnimFrame = (function() { + return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60) } +})() + +// because it's so fucking difficult to detect the scrolling element, just move them all +function move(amount) { + document.documentElement.scrollTop = amount + document.body.parentNode.scrollTop = amount + document.body.scrollTop = amount +} + +function position() { + return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop +} + +export function scrollTo(to, duration, callback) { + const start = position() + const change = to - start + const increment = 20 + let currentTime = 0 + duration = (typeof (duration) === 'undefined') ? 500 : duration + var animateScroll = function() { + // increment the time + currentTime += increment + // find the value with the quadratic in-out easing function + var val = Math.easeInOutQuad(currentTime, start, change, duration) + // move the document.body + move(val) + // do the animation unless its over + if (currentTime < duration) { + requestAnimFrame(animateScroll) + } else { + if (callback && typeof (callback) === 'function') { + // the animation is done so lets callback + callback() + } + } + } + animateScroll() +} diff --git a/src/views/example/list.vue b/src/views/example/list.vue index 4ab61d38..85ae4e43 100644 --- a/src/views/example/list.vue +++ b/src/views/example/list.vue @@ -50,26 +50,18 @@ -
- -
+ + + diff --git a/src/lang/en.js b/src/lang/en.js index 021bc66c..930f0ad1 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -22,6 +22,7 @@ export default { componentMixin: 'Mixin', backToTop: 'BackToTop', dragDialog: 'Drag Dialog', + dragSelect: 'Drag Select', dragKanban: 'Drag Kanban', charts: 'Charts', keyboardChart: 'Keyboard Chart', diff --git a/src/lang/es.js b/src/lang/es.js index 19171904..f16044c4 100755 --- a/src/lang/es.js +++ b/src/lang/es.js @@ -22,6 +22,7 @@ export default { componentMixin: 'Mixin', backToTop: 'Ir arriba', dragDialog: 'Drag Dialog', + dragSelect: 'Drag Select', dragKanban: 'Drag Kanban', charts: 'Gráficos', keyboardChart: 'Keyboard Chart', diff --git a/src/lang/zh.js b/src/lang/zh.js index 9da9e9e4..46e96ccf 100644 --- a/src/lang/zh.js +++ b/src/lang/zh.js @@ -22,6 +22,7 @@ export default { componentMixin: '小组件', backToTop: '返回顶部', dragDialog: '拖拽 Dialog', + dragSelect: '拖拽 Select', dragKanban: '可拖拽看板', charts: '图表', keyboardChart: '键盘图表', diff --git a/src/router/modules/components.js b/src/router/modules/components.js index 56dad2b1..5fd9bd29 100644 --- a/src/router/modules/components.js +++ b/src/router/modules/components.js @@ -78,6 +78,12 @@ const componentsRouter = { name: 'DragDialogDemo', meta: { title: 'dragDialog' } }, + { + path: 'drag-select', + component: () => import('@/views/components-demo/dragSelect'), + name: 'DragSelectDemo', + meta: { title: 'dragSelect' } + }, { path: 'dnd-list', component: () => import('@/views/components-demo/dndList'), diff --git a/src/views/components-demo/dragSelect.vue b/src/views/components-demo/dragSelect.vue new file mode 100644 index 00000000..559e8a57 --- /dev/null +++ b/src/views/components-demo/dragSelect.vue @@ -0,0 +1,43 @@ + + + From cbdad9cb1b836edccf9e25a3154bca9fc097326a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?= Date: Thu, 25 Oct 2018 10:42:18 +0800 Subject: [PATCH 13/22] fix[TagsView]: fix openMenu boundary display bug (#1256) --- src/views/layout/components/TagsView.vue | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/views/layout/components/TagsView.vue b/src/views/layout/components/TagsView.vue index c9413129..c16827b6 100644 --- a/src/views/layout/components/TagsView.vue +++ b/src/views/layout/components/TagsView.vue @@ -121,11 +121,21 @@ export default { this.$router.push('/') }, openMenu(tag, e) { + const menuMinWidth = 105 + const offsetLeft = this.$el.getBoundingClientRect().left // container margin left + const offsetWidth = this.$el.offsetWidth // container width + const maxLeft = offsetWidth - menuMinWidth // left boundary + const left = e.clientX - offsetLeft + 15 // 15: margin right + + if (left > maxLeft) { + this.left = maxLeft + } else { + this.left = left + } + this.top = e.clientY + this.visible = true this.selectedTag = tag - const offsetLeft = this.$el.getBoundingClientRect().left // container margin left - this.left = e.clientX - offsetLeft + 15 // 15: margin right - this.top = e.clientY }, closeMenu() { this.visible = false From 1d684b76328e3f6bcd3f75ea011087cce1c13a3c Mon Sep 17 00:00:00 2001 From: Pan Date: Fri, 26 Oct 2018 10:44:18 +0800 Subject: [PATCH 14/22] [release] 3.9.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7bbaa960..d795d163 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-element-admin", - "version": "3.9.2", + "version": "3.9.3", "description": "A magical vue admin. Typical templates for enterprise applications. Newest development stack of vue. Lots of awesome features", "author": "Pan ", "license": "MIT", From 1701fcce5d8f43d96ca61109d2b08d4d106b18d5 Mon Sep 17 00:00:00 2001 From: LarchLiu Date: Fri, 2 Nov 2018 15:07:39 +0800 Subject: [PATCH 15/22] fix[Charts]: fixed charts resize mixins bug #1285 (#1290) --- src/components/Charts/mixins/resize.js | 12 ++++++++---- src/views/dashboard/admin/components/LineChart.vue | 10 +++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/components/Charts/mixins/resize.js b/src/components/Charts/mixins/resize.js index dc61f859..c4c432f4 100644 --- a/src/components/Charts/mixins/resize.js +++ b/src/components/Charts/mixins/resize.js @@ -1,6 +1,11 @@ import { debounce } from '@/utils' export default { + data() { + return { + sidebarElm: null + } + }, mounted() { this.__resizeHandler = debounce(() => { if (this.chart) { @@ -9,14 +14,13 @@ export default { }, 100) window.addEventListener('resize', this.__resizeHandler) - const sidebarElm = document.getElementsByClassName('sidebar-container')[0] - sidebarElm.addEventListener('transitionend', this.sidebarResizeHandler) + this.sidebarElm = document.getElementsByClassName('sidebar-container')[0] + this.sidebarElm && this.sidebarElm.addEventListener('transitionend', this.sidebarResizeHandler) }, beforeDestroy() { window.removeEventListener('resize', this.__resizeHandler) - const sidebarElm = document.getElementsByClassName('sidebar-container')[0] - sidebarElm.removeEventListener('transitionend', this.sidebarResizeHandler) + this.sidebarElm && this.sidebarElm.removeEventListener('transitionend', this.sidebarResizeHandler) }, methods: { sidebarResizeHandler(e) { diff --git a/src/views/dashboard/admin/components/LineChart.vue b/src/views/dashboard/admin/components/LineChart.vue index ef493c4b..dfd121e5 100644 --- a/src/views/dashboard/admin/components/LineChart.vue +++ b/src/views/dashboard/admin/components/LineChart.vue @@ -32,7 +32,8 @@ export default { }, data() { return { - chart: null + chart: null, + sidebarElm: null } }, watch: { @@ -55,8 +56,8 @@ export default { } // 监听侧边栏的变化 - const sidebarElm = document.getElementsByClassName('sidebar-container')[0] - sidebarElm.addEventListener('transitionend', this.sidebarResizeHandler) + this.sidebarElm = document.getElementsByClassName('sidebar-container')[0] + this.sidebarElm && this.sidebarElm.addEventListener('transitionend', this.sidebarResizeHandler) }, beforeDestroy() { if (!this.chart) { @@ -66,8 +67,7 @@ export default { window.removeEventListener('resize', this.__resizeHandler) } - const sidebarElm = document.getElementsByClassName('sidebar-container')[0] - sidebarElm.removeEventListener('transitionend', this.sidebarResizeHandler) + this.sidebarElm && this.sidebarElm.removeEventListener('transitionend', this.sidebarResizeHandler) this.chart.dispose() this.chart = null From a25c63a580e177867d181ae678bd58837bf16c39 Mon Sep 17 00:00:00 2001 From: Pan Date: Fri, 2 Nov 2018 15:10:15 +0800 Subject: [PATCH 16/22] perf[Tinymce]: add searchreplace plugin --- src/components/Tinymce/toolbar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Tinymce/toolbar.js b/src/components/Tinymce/toolbar.js index 7d6c2c73..4f8a5450 100644 --- a/src/components/Tinymce/toolbar.js +++ b/src/components/Tinymce/toolbar.js @@ -1,6 +1,6 @@ // Here is a list of the toolbar // Detail list see https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols -const toolbar = ['bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample', 'hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen'] +const toolbar = ['searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample', 'hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen'] export default toolbar From 9f1552d98fb85e1e999066c43beb6d970e6b422d Mon Sep 17 00:00:00 2001 From: jaysunxiao <34591889+jaysunxiao@users.noreply.github.com> Date: Tue, 6 Nov 2018 16:11:47 +0800 Subject: [PATCH 17/22] perf[avatar]:minimize the selected area of avatar on the mobile phone when user clicked avatar (#1304) --- src/views/layout/components/Navbar.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/layout/components/Navbar.vue b/src/views/layout/components/Navbar.vue index 7bae38e0..208186e3 100644 --- a/src/views/layout/components/Navbar.vue +++ b/src/views/layout/components/Navbar.vue @@ -130,15 +130,16 @@ export default { height: 50px; margin-right: 30px; .avatar-wrapper { - cursor: pointer; margin-top: 5px; position: relative; .user-avatar { + cursor: pointer; width: 40px; height: 40px; border-radius: 10px; } .el-icon-caret-bottom { + cursor: pointer; position: absolute; right: -20px; top: 25px; From a0862ca54724d5729de1c67d4df15e87b721bb8a Mon Sep 17 00:00:00 2001 From: Pan Date: Thu, 8 Nov 2018 17:19:12 +0800 Subject: [PATCH 18/22] fix[DragSelect]: fixed querySelectorAll bug --- src/components/DragSelect/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/DragSelect/index.vue b/src/components/DragSelect/index.vue index a08d400a..28830259 100644 --- a/src/components/DragSelect/index.vue +++ b/src/components/DragSelect/index.vue @@ -1,5 +1,5 @@ @@ -30,7 +30,7 @@ export default { }, methods: { setSort() { - const el = document.querySelectorAll('.el-select__tags > span')[0] + const el = this.$refs.dragSelect.$el.querySelectorAll('.el-select__tags > span')[0] this.sortable = Sortable.create(el, { ghostClass: 'sortable-ghost', // Class name for the drop placeholder, setData: function(dataTransfer) { From 4a7b50ed464efe716ab05950b9d630aa106d82ce Mon Sep 17 00:00:00 2001 From: Pan Date: Thu, 8 Nov 2018 17:30:17 +0800 Subject: [PATCH 19/22] perf[DragSelect]: add $listeners --- src/components/DragSelect/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DragSelect/index.vue b/src/components/DragSelect/index.vue index 28830259..513be006 100644 --- a/src/components/DragSelect/index.vue +++ b/src/components/DragSelect/index.vue @@ -1,5 +1,5 @@ From 9df740bcf1a55c7cfc90a1744c39fe4a1d231a14 Mon Sep 17 00:00:00 2001 From: Pan Date: Fri, 9 Nov 2018 09:51:29 +0800 Subject: [PATCH 20/22] fix link --- src/components/TreeTable/readme.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/TreeTable/readme.md b/src/components/TreeTable/readme.md index 2a3b5af8..5b598e11 100644 --- a/src/components/TreeTable/readme.md +++ b/src/components/TreeTable/readme.md @@ -41,9 +41,9 @@ 1. text: 显示在表头的文字 2. value: 对应data的key。treeTable将显示相应的value 3. width: 每列的宽度,为一个数字(可选) - + 如果你想要每个字段都有自定义的样式或者嵌套其他组件,columns可不提供,直接像在el-table一样写即可,如果没有自定义内容,提供columns将更加的便捷方便 - + 如果你有几个字段是需要自定义的,几个不需要,那么可以将不需要自定义的字段放入columns,将需要自定义的内容放入到slot中,详情见后文 ```javascript [{ @@ -65,7 +65,7 @@ 如果不提供,将使用默认的[evalFunc](./eval.js) - 如果提供了evalFunc,那么会用提供的evalFunc去解析data,并返回treeTable渲染所需要的值。如何编写一个evalFunc,请参考[*eval.js*](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/components/TreeTable/eval.js)或[*customEval.js*](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/example/table/treeTable/customEval.js) + 如果提供了evalFunc,那么会用提供的evalFunc去解析data,并返回treeTable渲染所需要的值。如何编写一个evalFunc,请参考[*eval.js*](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/components/TreeTable/eval.js)或[*customEval.js*](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/table/treeTable/customEval.js) #### evalArgs 解析函数的参数,是一个数组 @@ -73,16 +73,16 @@ **请注意,自定义的解析函数参数第一个为this.data,第二个参数为, this.expandAll,你不需要在evalArgs填写。一定记住,这两个参数是强制性的,并且位置不可颠倒** *this.data为需要解析的数据,this.expandAll为是否默认展开* 如你的解析函数需要的参数为`(this.data, this.expandAll,1,2,3,4)`,那么你只需要将`[1,2,3,4]`赋值给`evalArgs`就可以了 - + 如果你的解析函数参数只有`(this.data, this.expandAll)`,那么就可以不用填写evalArgs了 - - 具体可参考[*customEval.js*](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/example/table/treeTable/customEval.js)的函数参数和[customTreeTable](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/example/table/treeTable/customTreeTable.vue)的`evalArgs`属性值 + + 具体可参考[*customEval.js*](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/table/treeTable/customEval.js)的函数参数和[customTreeTable](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/table/treeTable/customTreeTable.vue)的`evalArgs`属性值 ## slot 这是一个自定义列的插槽。 - - 默认情况下,treeTable只有一行行展示数据的功能。但是一般情况下,我们会要给行加上一个操作按钮或者根据当行数据展示不同的样式,这时我们就需要自定义列了。请参考[customTreeTable](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/example/table/treeTable/customTreeTable.vue),[实例效果](http://panjiachen.github.io/vue-element-admin/#/example/table/custom-tree-table) - + + 默认情况下,treeTable只有一行行展示数据的功能。但是一般情况下,我们会要给行加上一个操作按钮或者根据当行数据展示不同的样式,这时我们就需要自定义列了。请参考[customTreeTable](https://github.com/PanJiaChen/vue-element-admin/blob/master/src/views/table/treeTable/customTreeTable.vue),[实例效果](https://panjiachen.github.io/vue-element-admin/#/table/tree-table) + `slot`和`columns属性`可同时存在,columns里面的数据列会在slot自定义列的左边展示 ## 其他 From c13b5747940feb74dcf7888b6c4aeada24e5f1cc Mon Sep 17 00:00:00 2001 From: Pan Date: Fri, 9 Nov 2018 13:37:23 +0800 Subject: [PATCH 21/22] fix[Breadcurmb]: fixed pathCompile bug --- src/components/Breadcrumb/index.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index 32a8fb69..70ecbf1b 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -3,7 +3,7 @@ {{ generateTitle(item.meta.title) }} - {{ generateTitle(item.meta.title) }} + {{ generateTitle(item.meta.title) }} @@ -30,12 +30,8 @@ export default { methods: { generateTitle, getBreadcrumb() { - const { params } = this.$route let matched = this.$route.matched.filter(item => { if (item.name) { - // To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561 - var toPath = pathToRegexp.compile(item.path) - item.path = toPath(params) return true } }) @@ -44,6 +40,12 @@ export default { matched = [{ path: '/dashboard', meta: { title: 'dashboard' }}].concat(matched) } this.levelList = matched + }, + pathCompile(path) { + // To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561 + const { params } = this.$route + var toPath = pathToRegexp.compile(path) + return toPath(params) } } } From a51d72f42e27773a1f55beade504b79b3b8a5b46 Mon Sep 17 00:00:00 2001 From: Pan Date: Fri, 9 Nov 2018 17:59:34 +0800 Subject: [PATCH 22/22] fix[Breadcurmb]: fixed router-link bug --- src/components/Breadcrumb/index.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index 70ecbf1b..554abe8d 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -3,7 +3,7 @@ {{ generateTitle(item.meta.title) }} - {{ generateTitle(item.meta.title) }} + {{ generateTitle(item.meta.title) }} @@ -46,6 +46,14 @@ export default { const { params } = this.$route var toPath = pathToRegexp.compile(path) return toPath(params) + }, + handleLink(item) { + const { redirect, path } = item + if (redirect) { + this.$router.push(redirect) + return + } + this.$router.push(this.pathCompile(path)) } } }