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 @@
-
-
-
+
-
-
diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue
index 9698232b..8d104e84 100644
--- a/src/components/Pagination/index.vue
+++ b/src/components/Pagination/index.vue
@@ -5,6 +5,7 @@
:current-page.sync="currentPage"
:page-size.sync="pageSize"
:layout="layout"
+ :page-sizes="pageSizes"
:total="total"
v-bind="$attrs"
@size-change="handleSizeChange"
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
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自定义列的左边展示
## 其他
diff --git a/src/components/Upload/singleImage3.vue b/src/components/Upload/singleImage3.vue
index 637b9e1e..2cce98da 100644
--- a/src/components/Upload/singleImage3.vue
+++ b/src/components/Upload/singleImage3.vue
@@ -83,7 +83,7 @@ export default {
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
diff --git a/src/views/example/components/ArticleDetail.vue b/src/views/example/components/ArticleDetail.vue
index 6ac6feae..ce22b3b4 100644
--- a/src/views/example/components/ArticleDetail.vue
+++ b/src/views/example/components/ArticleDetail.vue
@@ -234,7 +234,7 @@ export default {