diff --git a/mock/role/routes.js b/mock/role/routes.js index 62a09d01..5bb6c741 100644 --- a/mock/role/routes.js +++ b/mock/role/routes.js @@ -129,7 +129,7 @@ export const asyncRoutes = [ { path: '/components', component: 'layout/Layout', - redirect: 'noredirect', + redirect: 'noRedirect', name: 'ComponentDemo', meta: { title: 'components', @@ -225,7 +225,7 @@ export const asyncRoutes = [ { path: '/charts', component: 'layout/Layout', - redirect: 'noredirect', + redirect: 'noRedirect', name: 'Charts', meta: { title: 'charts', @@ -361,7 +361,7 @@ export const asyncRoutes = [ { path: '/error', component: 'layout/Layout', - redirect: 'noredirect', + redirect: 'noRedirect', name: 'ErrorPages', meta: { title: 'errorPages', @@ -386,7 +386,7 @@ export const asyncRoutes = [ { path: '/error-log', component: 'layout/Layout', - redirect: 'noredirect', + redirect: 'noRedirect', children: [ { path: 'log', @@ -472,7 +472,7 @@ export const asyncRoutes = [ { path: '/theme', component: 'layout/Layout', - redirect: 'noredirect', + redirect: 'noRedirect', children: [ { path: 'index', @@ -486,7 +486,7 @@ export const asyncRoutes = [ { path: '/clipboard', component: 'layout/Layout', - redirect: 'noredirect', + redirect: 'noRedirect', children: [ { path: 'index', diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index f6993a61..29f9a04c 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -2,7 +2,7 @@ - {{ item.meta.title }} + {{ item.meta.title }} {{ item.meta.title }} @@ -28,15 +28,23 @@ export default { }, methods: { getBreadcrumb() { - let matched = this.$route.matched.filter(item => item.name) - + // only show routes with meta.title + let matched = this.$route.matched.filter(item => item.meta && item.meta.title) const first = matched[0] - if (first && first.name.trim().toLocaleLowerCase() !== 'Dashboard'.toLocaleLowerCase()) { + + if (!this.isDashboard(first)) { matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched) } this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) }, + isDashboard(route) { + const name = route && route.name + if (!name) { + return false + } + return name.trim().toLocaleLowerCase() === 'Dashboard'.toLocaleLowerCase() + }, pathCompile(path) { // To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561 const { params } = this.$route diff --git a/src/components/HeaderSearch/index.vue b/src/components/HeaderSearch/index.vue index 643d498c..af047168 100644 --- a/src/components/HeaderSearch/index.vue +++ b/src/components/HeaderSearch/index.vue @@ -111,7 +111,7 @@ export default { if (router.meta && router.meta.title) { data.title = [...data.title, router.meta.title] - if (router.redirect !== 'noredirect') { + if (router.redirect !== 'noRedirect') { // only push the routes with title // special case: need to exclude parent router without redirect res.push(data) diff --git a/src/directive/el-table/adaptive.js b/src/directive/el-table/adaptive.js index 8beacff1..d229e9fd 100644 --- a/src/directive/el-table/adaptive.js +++ b/src/directive/el-table/adaptive.js @@ -4,7 +4,7 @@ import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/re * How to use * ... * el-table height is must be set - * bottomOffset: 30(default) // The height of the table from the bottom of the page. + * bottomOffset: 30(default) // The height of the table from the bottom of the page. */ const doResize = (el, binding, vnode) => { @@ -29,13 +29,13 @@ export default { el.resizeListener = () => { doResize(el, binding, vnode) } - - addResizeListener(el, el.resizeListener) + // parameter 1 is must be "Element" type + addResizeListener(window.document.body, el.resizeListener) }, inserted(el, binding, vnode) { doResize(el, binding, vnode) }, unbind(el) { - removeResizeListener(el, el.resizeListener) + removeResizeListener(window.document.body, el.resizeListener) } } diff --git a/src/router/index.js b/src/router/index.js index 9e21cb90..dadb8e24 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -20,7 +20,7 @@ import nestedRouter from './modules/nested' * alwaysShow: true if set true, will always show the root menu * if not set alwaysShow, when item has more than one children route, * it will becomes nested mode, otherwise not show the root menu - * redirect: noredirect if `redirect:noredirect` will no redirect in the breadcrumb + * redirect: noRedirect if set noRedirect will no redirect in the breadcrumb * name:'router-name' the name is used by (must set!!!) * meta : { roles: ['admin','editor'] control the page roles (you can set multiple roles) @@ -224,7 +224,7 @@ export const asyncRoutes = [ { path: '/error', component: Layout, - redirect: 'noredirect', + redirect: 'noRedirect', name: 'ErrorPages', meta: { title: 'Error Pages', @@ -249,7 +249,6 @@ export const asyncRoutes = [ { path: '/error-log', component: Layout, - redirect: 'noredirect', children: [ { path: 'log', @@ -336,7 +335,6 @@ export const asyncRoutes = [ { path: '/theme', component: Layout, - redirect: 'noredirect', children: [ { path: 'index', @@ -350,7 +348,6 @@ export const asyncRoutes = [ { path: '/clipboard', component: Layout, - redirect: 'noredirect', children: [ { path: 'index', diff --git a/src/router/modules/charts.js b/src/router/modules/charts.js index 6b74e90a..29684dec 100644 --- a/src/router/modules/charts.js +++ b/src/router/modules/charts.js @@ -5,7 +5,7 @@ import Layout from '@/layout' const chartsRouter = { path: '/charts', component: Layout, - redirect: 'noredirect', + redirect: 'noRedirect', name: 'Charts', meta: { title: 'Charts', diff --git a/src/router/modules/components.js b/src/router/modules/components.js index 0035ea36..0da96f97 100644 --- a/src/router/modules/components.js +++ b/src/router/modules/components.js @@ -5,7 +5,7 @@ import Layout from '@/layout' const componentsRouter = { path: '/components', component: Layout, - redirect: 'noredirect', + redirect: 'noRedirect', name: 'ComponentDemo', meta: { title: 'Components', diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss index 9422dd18..9581d56a 100644 --- a/src/styles/element-ui.scss +++ b/src/styles/element-ui.scss @@ -46,7 +46,7 @@ } } -//暂时性解决dialog 问题 https://github.com/ElemeFE/element/issues/2461 +// to fixed https://github.com/ElemeFE/element/issues/2461 .el-dialog { transform: none; left: 0; @@ -54,18 +54,7 @@ margin: 0 auto; } -//文章页textarea修改样式 -.article-textarea { - textarea { - padding-right: 40px; - resize: none; - border: none; - border-radius: 0px; - border-bottom: 1px solid #bfcbd9; - } -} - -//element ui upload +// refine element ui upload .upload-container { .el-upload { width: 100%; @@ -77,9 +66,14 @@ } } -//dropdown +// dropdown .el-dropdown-menu { a { display: block } } + +// fix date-picker ui bug in filter-item +.el-range-editor.el-input__inner { + display: inline-flex !important; +} diff --git a/src/views/example/components/ArticleDetail.vue b/src/views/example/components/ArticleDetail.vue index 734209b3..7e94e505 100644 --- a/src/views/example/components/ArticleDetail.vue +++ b/src/views/example/components/ArticleDetail.vue @@ -60,7 +60,7 @@ - {{ contentShortLength }}字 + {{ contentShortLength }}words @@ -237,24 +237,39 @@ export default { diff --git a/src/views/example/components/Warning.vue b/src/views/example/components/Warning.vue index bd8a2536..8d2a7e5a 100644 --- a/src/views/example/components/Warning.vue +++ b/src/views/example/components/Warning.vue @@ -1,4 +1,4 @@ -