merge master

This commit is contained in:
Pan 2019-04-16 15:04:52 +08:00
commit e0829be58e
10 changed files with 54 additions and 39 deletions

View File

@ -129,7 +129,7 @@ export const asyncRoutes = [
{ {
path: '/components', path: '/components',
component: 'layout/Layout', component: 'layout/Layout',
redirect: 'noredirect', redirect: 'noRedirect',
name: 'ComponentDemo', name: 'ComponentDemo',
meta: { meta: {
title: 'components', title: 'components',
@ -225,7 +225,7 @@ export const asyncRoutes = [
{ {
path: '/charts', path: '/charts',
component: 'layout/Layout', component: 'layout/Layout',
redirect: 'noredirect', redirect: 'noRedirect',
name: 'Charts', name: 'Charts',
meta: { meta: {
title: 'charts', title: 'charts',
@ -361,7 +361,7 @@ export const asyncRoutes = [
{ {
path: '/error', path: '/error',
component: 'layout/Layout', component: 'layout/Layout',
redirect: 'noredirect', redirect: 'noRedirect',
name: 'ErrorPages', name: 'ErrorPages',
meta: { meta: {
title: 'errorPages', title: 'errorPages',
@ -386,7 +386,7 @@ export const asyncRoutes = [
{ {
path: '/error-log', path: '/error-log',
component: 'layout/Layout', component: 'layout/Layout',
redirect: 'noredirect', redirect: 'noRedirect',
children: [ children: [
{ {
path: 'log', path: 'log',
@ -472,7 +472,7 @@ export const asyncRoutes = [
{ {
path: '/theme', path: '/theme',
component: 'layout/Layout', component: 'layout/Layout',
redirect: 'noredirect', redirect: 'noRedirect',
children: [ children: [
{ {
path: 'index', path: 'index',
@ -486,7 +486,7 @@ export const asyncRoutes = [
{ {
path: '/clipboard', path: '/clipboard',
component: 'layout/Layout', component: 'layout/Layout',
redirect: 'noredirect', redirect: 'noRedirect',
children: [ children: [
{ {
path: 'index', path: 'index',

View File

@ -2,7 +2,7 @@
<el-breadcrumb class="app-breadcrumb" separator="/"> <el-breadcrumb class="app-breadcrumb" separator="/">
<transition-group name="breadcrumb"> <transition-group name="breadcrumb">
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path"> <el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
<span v-if="item.redirect==='noredirect'||index==levelList.length-1" class="no-redirect">{{ item.meta.title }}</span> <span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect">{{ item.meta.title }}</span>
<a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a> <a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
</el-breadcrumb-item> </el-breadcrumb-item>
</transition-group> </transition-group>
@ -28,15 +28,23 @@ export default {
}, },
methods: { methods: {
getBreadcrumb() { 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] const first = matched[0]
if (first && first.name.trim().toLocaleLowerCase() !== 'Dashboard'.toLocaleLowerCase()) {
if (!this.isDashboard(first)) {
matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched) matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched)
} }
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) 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) { pathCompile(path) {
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561 // To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
const { params } = this.$route const { params } = this.$route

View File

@ -111,7 +111,7 @@ export default {
if (router.meta && router.meta.title) { if (router.meta && router.meta.title) {
data.title = [...data.title, router.meta.title] data.title = [...data.title, router.meta.title]
if (router.redirect !== 'noredirect') { if (router.redirect !== 'noRedirect') {
// only push the routes with title // only push the routes with title
// special case: need to exclude parent router without redirect // special case: need to exclude parent router without redirect
res.push(data) res.push(data)

View File

@ -4,7 +4,7 @@ import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/re
* How to use * How to use
* <el-table height="100px" v-el-height-adaptive-table="{bottomOffset: 30}">...</el-table> * <el-table height="100px" v-el-height-adaptive-table="{bottomOffset: 30}">...</el-table>
* el-table height is must be set * 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) => { const doResize = (el, binding, vnode) => {
@ -29,13 +29,13 @@ export default {
el.resizeListener = () => { el.resizeListener = () => {
doResize(el, binding, vnode) doResize(el, binding, vnode)
} }
// parameter 1 is must be "Element" type
addResizeListener(el, el.resizeListener) addResizeListener(window.document.body, el.resizeListener)
}, },
inserted(el, binding, vnode) { inserted(el, binding, vnode) {
doResize(el, binding, vnode) doResize(el, binding, vnode)
}, },
unbind(el) { unbind(el) {
removeResizeListener(el, el.resizeListener) removeResizeListener(window.document.body, el.resizeListener)
} }
} }

View File

@ -20,7 +20,7 @@ import nestedRouter from './modules/nested'
* alwaysShow: true if set true, will always show the root menu * alwaysShow: true if set true, will always show the root menu
* if not set alwaysShow, when item has more than one children route, * if not set alwaysShow, when item has more than one children route,
* it will becomes nested mode, otherwise not show the root menu * 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 <keep-alive> (must set!!!) * name:'router-name' the name is used by <keep-alive> (must set!!!)
* meta : { * meta : {
roles: ['admin','editor'] control the page roles (you can set multiple roles) roles: ['admin','editor'] control the page roles (you can set multiple roles)
@ -224,7 +224,7 @@ export const asyncRoutes = [
{ {
path: '/error', path: '/error',
component: Layout, component: Layout,
redirect: 'noredirect', redirect: 'noRedirect',
name: 'ErrorPages', name: 'ErrorPages',
meta: { meta: {
title: 'Error Pages', title: 'Error Pages',
@ -249,7 +249,6 @@ export const asyncRoutes = [
{ {
path: '/error-log', path: '/error-log',
component: Layout, component: Layout,
redirect: 'noredirect',
children: [ children: [
{ {
path: 'log', path: 'log',
@ -336,7 +335,6 @@ export const asyncRoutes = [
{ {
path: '/theme', path: '/theme',
component: Layout, component: Layout,
redirect: 'noredirect',
children: [ children: [
{ {
path: 'index', path: 'index',
@ -350,7 +348,6 @@ export const asyncRoutes = [
{ {
path: '/clipboard', path: '/clipboard',
component: Layout, component: Layout,
redirect: 'noredirect',
children: [ children: [
{ {
path: 'index', path: 'index',

View File

@ -5,7 +5,7 @@ import Layout from '@/layout'
const chartsRouter = { const chartsRouter = {
path: '/charts', path: '/charts',
component: Layout, component: Layout,
redirect: 'noredirect', redirect: 'noRedirect',
name: 'Charts', name: 'Charts',
meta: { meta: {
title: 'Charts', title: 'Charts',

View File

@ -5,7 +5,7 @@ import Layout from '@/layout'
const componentsRouter = { const componentsRouter = {
path: '/components', path: '/components',
component: Layout, component: Layout,
redirect: 'noredirect', redirect: 'noRedirect',
name: 'ComponentDemo', name: 'ComponentDemo',
meta: { meta: {
title: 'Components', title: 'Components',

View File

@ -46,7 +46,7 @@
} }
} }
//暂时性解决dialog 问题 https://github.com/ElemeFE/element/issues/2461 // to fixed https://github.com/ElemeFE/element/issues/2461
.el-dialog { .el-dialog {
transform: none; transform: none;
left: 0; left: 0;
@ -54,18 +54,7 @@
margin: 0 auto; margin: 0 auto;
} }
//文章页textarea修改样式 // refine element ui upload
.article-textarea {
textarea {
padding-right: 40px;
resize: none;
border: none;
border-radius: 0px;
border-bottom: 1px solid #bfcbd9;
}
}
//element ui upload
.upload-container { .upload-container {
.el-upload { .el-upload {
width: 100%; width: 100%;
@ -77,9 +66,14 @@
} }
} }
//dropdown // dropdown
.el-dropdown-menu { .el-dropdown-menu {
a { a {
display: block display: block
} }
} }
// fix date-picker ui bug in filter-item
.el-range-editor.el-input__inner {
display: inline-flex !important;
}

View File

@ -60,7 +60,7 @@
<el-form-item style="margin-bottom: 40px;" label-width="70px" label="Summary:"> <el-form-item style="margin-bottom: 40px;" label-width="70px" label="Summary:">
<el-input v-model="postForm.content_short" :rows="1" type="textarea" class="article-textarea" autosize placeholder="Please enter the content" /> <el-input v-model="postForm.content_short" :rows="1" type="textarea" class="article-textarea" autosize placeholder="Please enter the content" />
<span v-show="contentShortLength" class="word-counter">{{ contentShortLength }}</span> <span v-show="contentShortLength" class="word-counter">{{ contentShortLength }}words</span>
</el-form-item> </el-form-item>
<el-form-item prop="content" style="margin-bottom: 30px;"> <el-form-item prop="content" style="margin-bottom: 30px;">
@ -237,24 +237,39 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import "~@/styles/mixin.scss"; @import "~@/styles/mixin.scss";
.createPost-container { .createPost-container {
position: relative; position: relative;
.createPost-main-container { .createPost-main-container {
padding: 40px 45px 20px 50px; padding: 40px 45px 20px 50px;
.postInfo-container { .postInfo-container {
position: relative; position: relative;
@include clearfix; @include clearfix;
margin-bottom: 10px; margin-bottom: 10px;
.postInfo-container-item { .postInfo-container-item {
float: left; float: left;
} }
} }
} }
.word-counter { .word-counter {
width: 40px; width: 40px;
position: absolute; position: absolute;
right: -10px; right: 10px;
top: 0px; top: 0px;
} }
} }
.article-textarea /deep/ {
textarea {
padding-right: 40px;
resize: none;
border: none;
border-radius: 0px;
border-bottom: 1px solid #bfcbd9;
}
}
</style> </style>

View File

@ -1,4 +1,4 @@
<template functional> <template>
<aside> <aside>
Creating and editing pages cannot be cached by keep-alive because keep-alive include does not currently support Creating and editing pages cannot be cached by keep-alive because keep-alive include does not currently support
caching based on routes, so it is currently cached based on component name. If you want to achieve a similar caching caching based on routes, so it is currently cached based on component name. If you want to achieve a similar caching
@ -10,3 +10,4 @@
>Document</a> >Document</a>
</aside> </aside>
</template> </template>