diff --git a/README.md b/README.md index e2d9c034..d0ff7d74 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,11 @@ Understanding and learning this knowledge in advance will greatly help the use o

+## Sponsors +Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor]](https://www.patreon.com/panjiachen) + +

Admin Dashboard Templates made with Vue, React and Angular.

+ ## Features ``` diff --git a/README.zh-CN.md b/README.zh-CN.md index 28fc0240..55882115 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -81,6 +81,11 @@

+## Sponsors +Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor]](https://www.patreon.com/panjiachen) + +

Admin Dashboard Templates made with Vue, React and Angular.

+ ## 功能 ``` diff --git a/package.json b/package.json index 037c8010..4cdf939e 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", @@ -44,7 +44,6 @@ "echarts": "4.1.0", "element-ui": "2.4.6", "file-saver": "1.3.8", - "font-awesome": "4.7.0", "js-cookie": "2.2.0", "jsonlint": "1.6.3", "jszip": "3.1.5", @@ -53,13 +52,13 @@ "nprogress": "0.2.0", "screenfull": "3.3.3", "showdown": "1.8.6", - "simplemde": "1.11.2", "sortablejs": "1.7.0", + "tui-editor": "1.2.7", "vue": "2.5.17", "vue-analytics": "5.16.0", "vue-count-to": "1.0.13", "vue-i18n": "7.3.2", - "vue-router": "3.0.1", + "vue-router": "3.0.2", "vue-splitpane": "1.0.2", "vuedraggable": "^2.16.0", "vuex": "3.0.1", diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index 32a8fb69..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) }} @@ -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,20 @@ 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) + }, + handleLink(item) { + const { redirect, path } = item + if (redirect) { + this.$router.push(redirect) + return + } + this.$router.push(this.pathCompile(path)) } } } 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/components/DragSelect/index.vue b/src/components/DragSelect/index.vue index a08d400a..513be006 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) { diff --git a/src/components/MarkdownEditor/defaultOptions.js b/src/components/MarkdownEditor/defaultOptions.js new file mode 100644 index 00000000..303aa13d --- /dev/null +++ b/src/components/MarkdownEditor/defaultOptions.js @@ -0,0 +1,31 @@ +// doc: https://nhnent.github.io/tui.editor/api/latest/ToastUIEditor.html#ToastUIEditor +export default { + minHeight: '200px', + previewStyle: 'vertical', + useCommandShortcut: true, + useDefaultHTMLSanitizer: true, + usageStatistics: false, + hideModeSwitch: false, + toolbarItems: [ + 'heading', + 'bold', + 'italic', + 'strike', + 'divider', + 'hr', + 'quote', + 'divider', + 'ul', + 'ol', + 'task', + 'indent', + 'outdent', + 'divider', + 'table', + 'image', + 'link', + 'divider', + 'code', + 'codeblock' + ] +} diff --git a/src/components/MarkdownEditor/index.vue b/src/components/MarkdownEditor/index.vue index 9847668a..4a6d8b0f 100644 --- a/src/components/MarkdownEditor/index.vue +++ b/src/components/MarkdownEditor/index.vue @@ -1,16 +1,18 @@