diff --git a/README.md b/README.md
index e2d9c034..bf0e08be 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@
-
+
@@ -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
```
@@ -87,7 +92,7 @@ Understanding and learning this knowledge in advance will greatly help the use o
- Multiple dynamic themes
- Dynamic sidebar (supports multi-level routing)
- Dynamic breadcrumb
- - Tags-view(Tab page Support right-click operation)
+ - Tags-view (Tab page Support right-click operation)
- Svg Sprite
- Mock data
- Screenfull
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 28fc0240..5dc9f1d7 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -7,7 +7,7 @@
-
+
@@ -40,7 +40,7 @@
- [Wiki](https://github.com/PanJiaChen/vue-element-admin/wiki)
-- [Donate](https://panjiachen.github.io/vue-element-admin-site/zh/donate/)
+- [Donate](https://panjiachen.gitee.io/vue-element-admin-site/zh/donate)
- [Gitee](https://panjiachen.gitee.io/vue-element-admin/) 国内用户可访问该地址在线预览
@@ -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.
+
## 功能
```
@@ -209,6 +214,8 @@ Detailed changes for each release are documented in the [release notes](https://
如果你觉得这个项目帮助到了你,你可以帮作者买一杯果汁表示鼓励 :tropical_drink:

+[更多捐赠方式](https://panjiachen.gitee.io/vue-element-admin-site/zh/donate)
+
[Paypal Me](https://www.paypal.me/panfree23)
## Browsers support
diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js
index 946a134a..4f84e0c6 100644
--- a/build/webpack.prod.conf.js
+++ b/build/webpack.prod.conf.js
@@ -150,7 +150,6 @@ if (config.build.productionGzip) {
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
- asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' + config.build.productionGzipExtensions.join('|') + ')$'
diff --git a/package.json b/package.json
index d795d163..aef30525 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "vue-element-admin",
- "version": "3.9.3",
+ "version": "3.10.0",
"description": "A magical vue admin. Typical templates for enterprise applications. Newest development stack of vue. Lots of awesome features",
"author": "Pan ",
"license": "MIT",
@@ -37,27 +37,26 @@
"axios": "0.18.0",
"clipboard": "1.7.1",
"codemirror": "5.39.2",
- "connect": "3.6.6",
- "driver.js": "0.5.2",
+ "driver.js": "0.8.1",
"dropzone": "5.2.0",
"echarts": "4.1.0",
- "element-ui": "2.4.6",
+ "element-ui": "2.4.11",
"file-saver": "1.3.8",
- "font-awesome": "4.7.0",
+ "fuse.js": "3.4.2",
"js-cookie": "2.2.0",
"jsonlint": "1.6.3",
"jszip": "3.1.5",
"mockjs": "1.0.1-beta3",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
- "screenfull": "3.3.3",
+ "screenfull": "4.0.0",
"showdown": "1.8.6",
- "simplemde": "1.11.2",
"sortablejs": "1.7.0",
+ "tui-editor": "1.2.7",
"vue": "2.5.17",
"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",
@@ -76,6 +75,8 @@
"babel-preset-env": "1.7.0",
"babel-preset-stage-2": "6.24.1",
"chalk": "2.4.1",
+ "compression-webpack-plugin": "2.0.0",
+ "connect": "3.6.6",
"copy-webpack-plugin": "4.5.2",
"cross-env": "5.2.0",
"css-loader": "1.0.0",
@@ -116,7 +117,7 @@
"webpack": "4.16.5",
"webpack-bundle-analyzer": "2.13.1",
"webpack-cli": "3.1.0",
- "webpack-dev-server": "3.1.5",
+ "webpack-dev-server": "3.1.14",
"webpack-merge": "4.1.4"
},
"engines": {
diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue
index 554abe8d..5f4d054f 100644
--- a/src/components/Breadcrumb/index.vue
+++ b/src/components/Breadcrumb/index.vue
@@ -1,8 +1,9 @@
-
- {{ generateTitle(item.meta.title) }}
+
+ {{
+ generateTitle(item.meta.title) }}
{{ generateTitle(item.meta.title) }}
@@ -30,16 +31,14 @@ export default {
methods: {
generateTitle,
getBreadcrumb() {
- let matched = this.$route.matched.filter(item => {
- if (item.name) {
- return true
- }
- })
+ let matched = this.$route.matched.filter(item => item.name)
+
const first = matched[0]
if (first && first.name.trim().toLocaleLowerCase() !== 'Dashboard'.toLocaleLowerCase()) {
matched = [{ path: '/dashboard', meta: { title: 'dashboard' }}].concat(matched)
}
- this.levelList = matched
+
+ this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
},
pathCompile(path) {
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
@@ -64,7 +63,7 @@ export default {
display: inline-block;
font-size: 14px;
line-height: 50px;
- margin-left: 10px;
+ margin-left: 8px;
.no-redirect {
color: #97a8be;
cursor: text;
diff --git a/src/components/DndList/index.vue b/src/components/DndList/index.vue
index 43e0bb28..7587daa7 100644
--- a/src/components/DndList/index.vue
+++ b/src/components/DndList/index.vue
@@ -4,7 +4,7 @@
{{ list1Title }}
-
[{{ element.author }}] {{ element.title }}
+
{{ element.id }}[{{ element.author }}] {{ element.title }}
@@ -15,9 +15,9 @@
{{ list2Title }}
-
-
-
[{{ element.author }}] {{ element.title }}
+
+
+
{{ element.id }} [{{ element.author }}] {{ element.title }}
@@ -60,16 +60,6 @@ export default {
default: '48%'
}
},
- computed: {
- filterList2() {
- return this.list2.filter(v => {
- if (this.isNotInList1(v)) {
- return v
- }
- return false
- })
- }
- },
methods: {
isNotInList1(v) {
return this.list1.every(k => v.id !== k.id)
@@ -90,7 +80,16 @@ export default {
}
},
pushEle(ele) {
- this.list1.push(ele)
+ for (const item of this.list2) {
+ if (item.id === ele.id) {
+ const index = this.list2.indexOf(item)
+ this.list2.splice(index, 1)
+ break
+ }
+ }
+ if (this.isNotInList1(ele)) {
+ this.list1.push(ele)
+ }
}
}
}
diff --git a/src/components/ErrorLog/index.vue b/src/components/ErrorLog/index.vue
index 1fd883d0..c46cf110 100644
--- a/src/components/ErrorLog/index.vue
+++ b/src/components/ErrorLog/index.vue
@@ -1,21 +1,8 @@
-
-
-
-
-
+
+
+
@@ -67,16 +54,6 @@ export default {
diff --git a/src/components/HeaderSearch/index.vue b/src/components/HeaderSearch/index.vue
new file mode 100644
index 00000000..ab0d556a
--- /dev/null
+++ b/src/components/HeaderSearch/index.vue
@@ -0,0 +1,187 @@
+
+
+
+
+
+
+
diff --git a/src/components/Kanban/index.vue b/src/components/Kanban/index.vue
index 4975dbdd..dadeb648 100644
--- a/src/components/Kanban/index.vue
+++ b/src/components/Kanban/index.vue
@@ -41,7 +41,7 @@ export default {
}
}
-
-
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/Screenfull/index.vue b/src/components/Screenfull/index.vue
index 4cdcb568..479bf3e3 100644
--- a/src/components/Screenfull/index.vue
+++ b/src/components/Screenfull/index.vue
@@ -1,29 +1,6 @@
@@ -32,25 +9,14 @@ import screenfull from 'screenfull'
export default {
name: 'Screenfull',
- props: {
- width: {
- type: Number,
- default: 22
- },
- height: {
- type: Number,
- default: 22
- },
- fill: {
- type: String,
- default: '#48576a'
- }
- },
data() {
return {
isFullscreen: false
}
},
+ mounted() {
+ this.init()
+ },
methods: {
click() {
if (!screenfull.enabled) {
@@ -61,6 +27,13 @@ export default {
return false
}
screenfull.toggle()
+ },
+ init() {
+ if (screenfull.enabled) {
+ screenfull.on('change', () => {
+ this.isFullscreen = screenfull.isFullscreen
+ })
+ }
}
}
}
diff --git a/src/components/ScrollPane/index.vue b/src/components/ScrollPane/index.vue
index 89998e80..172afccc 100644
--- a/src/components/ScrollPane/index.vue
+++ b/src/components/ScrollPane/index.vue
@@ -28,8 +28,6 @@ export default {
let firstTag = null
let lastTag = null
- let prevTag = null
- let nextTag = null
// find first tag and last tag
if (tagList.length > 0) {
@@ -37,26 +35,15 @@ export default {
lastTag = tagList[tagList.length - 1]
}
- // find preTag and nextTag
- for (let i = 0; i < tagList.length; i++) {
- if (tagList[i] === currentTag) {
- if (i === 0) {
- nextTag = tagList[i].length > 1 && tagList[i + 1]
- } else if (i === tagList.length - 1) {
- prevTag = tagList[i].length > 1 && tagList[i - 1]
- } else {
- prevTag = tagList[i - 1]
- nextTag = tagList[i + 1]
- }
- break
- }
- }
-
if (firstTag === currentTag) {
$scrollWrapper.scrollLeft = 0
} else if (lastTag === currentTag) {
$scrollWrapper.scrollLeft = $scrollWrapper.scrollWidth - $containerWidth
} else {
+ // find preTag and nextTag
+ const currentIndex = tagList.findIndex(item => item === currentTag)
+ const prevTag = tagList[currentIndex - 1]
+ const nextTag = tagList[currentIndex + 1]
// the tag's offsetLeft after of nextTag
const afterNextTagOffsetLeft = nextTag.$el.offsetLeft + nextTag.$el.offsetWidth + tagAndTagSpacing
diff --git a/src/components/SizeSelect/index.vue b/src/components/SizeSelect/index.vue
index 0e428a23..6d3cd43a 100644
--- a/src/components/SizeSelect/index.vue
+++ b/src/components/SizeSelect/index.vue
@@ -4,15 +4,24 @@
- Medium
- Small
- Mini
+ {{
+ item.label }}
-
-
-
diff --git a/src/components/Sticky/index.vue b/src/components/Sticky/index.vue
index e0fb7c57..5624a989 100644
--- a/src/components/Sticky/index.vue
+++ b/src/components/Sticky/index.vue
@@ -56,23 +56,27 @@ export default {
this.width = this.width + 'px'
this.isSticky = true
},
- reset() {
+ handleReset() {
if (!this.active) {
return
}
+ this.reset()
+ },
+ reset() {
this.position = ''
this.width = 'auto'
this.active = false
this.isSticky = false
},
handleScroll() {
- this.width = this.$el.getBoundingClientRect().width
+ const width = this.$el.getBoundingClientRect().width
+ this.width = width || 'auto'
const offsetTop = this.$el.getBoundingClientRect().top
if (offsetTop < this.stickyTop) {
this.sticky()
return
}
- this.reset()
+ this.handleReset()
},
handleReize() {
if (this.isSticky) {
diff --git a/src/components/SvgIcon/index.vue b/src/components/SvgIcon/index.vue
index 12a1f58d..b0b6d4cb 100644
--- a/src/components/SvgIcon/index.vue
+++ b/src/components/SvgIcon/index.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/src/components/ThemePicker/index.vue b/src/components/ThemePicker/index.vue
index e797d6c2..52419929 100644
--- a/src/components/ThemePicker/index.vue
+++ b/src/components/ThemePicker/index.vue
@@ -18,7 +18,8 @@ export default {
}
},
watch: {
- theme(val, oldVal) {
+ theme(val) {
+ const oldVal = this.theme
if (typeof val !== 'string') return
const themeCluster = this.getThemeCluster(val.replace('#', ''))
const originalCluster = this.getThemeCluster(oldVal.replace('#', ''))
@@ -66,11 +67,18 @@ export default {
methods: {
updateStyle(style, oldCluster, newCluster) {
- let newStyle = style
+ const colorOverrides = [] // only capture color overides
oldCluster.forEach((color, index) => {
- newStyle = newStyle.replace(new RegExp(color, 'ig'), newCluster[index])
+ const value = newCluster[index]
+ const color_plain = color.replace(/([()])/g, '\\$1')
+ const repl = new RegExp(`(^|})([^{]+{[^{}]+)${color_plain}\\b([^}]*)(?=})`, 'gi')
+ const nestRepl = new RegExp(color_plain, 'ig') // for greed matching before the 'color'
+ let v
+ while ((v = repl.exec(style))) {
+ colorOverrides.push(v[2].replace(nestRepl, value) + value + v[3] + '}') // '}' not captured in the regexp repl to reserve it as locator-boundary
+ }
})
- return newStyle
+ return colorOverrides.join('')
},
getCSSString(url, callback, variable) {
@@ -135,7 +143,10 @@ export default {
diff --git a/src/views/errorPage/404.vue b/src/views/errorPage/404.vue
index c3eafea0..6483fd5f 100644
--- a/src/views/errorPage/404.vue
+++ b/src/views/errorPage/404.vue
@@ -14,7 +14,7 @@
{{ message }}
请检查您输入的网址是否正确,请点击以下按钮返回主页或者发送错误报告
-
返回首页
+
返回首页
diff --git a/src/views/example/components/ArticleDetail.vue b/src/views/example/components/ArticleDetail.vue
index ce22b3b4..1026559f 100644
--- a/src/views/example/components/ArticleDetail.vue
+++ b/src/views/example/components/ArticleDetail.vue
@@ -60,13 +60,13 @@
{{ contentShortLength }}字
-
+
-
+
-
+
-
+
@@ -78,7 +78,7 @@ import Tinymce from '@/components/Tinymce'
import Upload from '@/components/Upload/singleImage3'
import MDinput from '@/components/MDinput'
import Sticky from '@/components/Sticky' // 粘性header组件
-import { validateURL } from '@/utils/validate'
+import { validURL } from '@/utils/validate'
import { fetchArticle } from '@/api/article'
import { userSearch } from '@/api/remoteSearch'
import Warning from './Warning'
@@ -121,7 +121,7 @@ export default {
}
const validateSourceUri = (rule, value, callback) => {
if (value) {
- if (validateURL(value)) {
+ if (validURL(value)) {
callback()
} else {
this.$message({
@@ -247,17 +247,6 @@ export default {
float: left;
}
}
- .editor-container {
- min-height: 500px;
- margin: 0 0 30px;
- .editor-upload-btn-container {
- text-align: right;
- margin-right: 10px;
- .editor-upload-btn {
- display: inline-block;
- }
- }
- }
}
.word-counter {
width: 40px;
diff --git a/src/views/guide/defineSteps.js b/src/views/guide/defineSteps.js
index fde78926..405a3f72 100644
--- a/src/views/guide/defineSteps.js
+++ b/src/views/guide/defineSteps.js
@@ -45,7 +45,8 @@ const steps = [
title: 'Tags view',
description: 'The history of the page you visited',
position: 'bottom'
- }
+ },
+ padding: 0
}
]
diff --git a/src/views/guide/index.vue b/src/views/guide/index.vue
index c30c52cf..49502aef 100644
--- a/src/views/guide/index.vue
+++ b/src/views/guide/index.vue
@@ -10,7 +10,7 @@
+
+
diff --git a/src/views/pdf/index.vue b/src/views/pdf/index.vue
new file mode 100644
index 00000000..b7728152
--- /dev/null
+++ b/src/views/pdf/index.vue
@@ -0,0 +1,9 @@
+
+
+ {{ $t('pdf.tips') }}
+
+ Click to download PDF
+
+
+
+
diff --git a/src/views/permission/directive.vue b/src/views/permission/directive.vue
index 2817f1c5..df277ddc 100644
--- a/src/views/permission/directive.vue
+++ b/src/views/permission/directive.vue
@@ -2,29 +2,53 @@
-
- Only
- admin can see this
-
-
- Only
- editor can see this
-
-
- Both
- admin and
- editor can see this
-
+
+
+ Only
+ admin can see this
+
+ v-permission="['admin']"
+
+
+
+
+ Only
+ editor can see this
+
+ v-permission="['editor']"
+
+
+
+
+ Both
+ admin and
+ editor can see this
+
+ v-permission="['admin','editor']"
+
-
-
In some cases it is not suitable to use v-permission, such as element Tab component which can only be achieved by manually setting the v-if.
+
+
+ {{ $t('permission.tips') }}
e.g.
-
- Admin can see this
- Editor can see this
- Both admin or editor can see this
+
+
+
+ Admin can see this
+ v-if="checkPermission(['admin'])"
+
+
+
+ Editor can see this
+ v-if="checkPermission(['editor'])"
+
+
+
+ Both admin or editor can see this
+ v-if="checkPermission(['admin','editor'])"
+
@@ -57,14 +81,17 @@ export default{
.app-container {
/deep/ .permission-alert {
width: 320px;
- margin-top: 30px;
+ margin-top: 15px;
background-color: #f0f9eb;
color: #67c23a;
padding: 8px 16px;
border-radius: 4px;
- display: block;
+ display: inline-block;
}
- /deep/ .permission-tag{
+ /deep/ .permission-sourceCode {
+ margin-left: 15px;
+ }
+ /deep/ .permission-tag {
background-color: #ecf5ff;
}
}
diff --git a/src/views/table/dragTable.vue b/src/views/table/dragTable.vue
index 8f52c5de..3f3fb941 100644
--- a/src/views/table/dragTable.vue
+++ b/src/views/table/dragTable.vue
@@ -46,7 +46,7 @@
-
+