优化GloablHeader、新增表单模块、新增PageHeader、根据router自动生成breadcrumb功能

This commit is contained in:
chenghx
2018-07-23 18:10:02 +08:00
parent 417f7d5f7b
commit 670b97e616
6 changed files with 224 additions and 3 deletions

View File

@@ -0,0 +1,53 @@
<template>
<div class="page-header">
<div class="breadcrumb">
<a-breadcrumb>
<a-breadcrumb-item><a href="#/dashboard">首页</a></a-breadcrumb-item>
<a-breadcrumb-item :key="item.path" v-for="item in breadcrumb">{{item.name}}</a-breadcrumb-item>
</a-breadcrumb>
</div>
<div class="detail">
<h1 v-if="title" class="title">{{title}}</h1>
<div class="content"><slot name="content"></slot></div>
</div>
</div>
</template>
<script>
import ABreadcrumb from 'vue-antd-ui/es/breadcrumb'
const ABreadcrumbItem = ABreadcrumb.Item
export default {
name: 'PageHeader',
components: {ABreadcrumbItem, ABreadcrumb},
props: {
title: {
type: String,
required: true
},
breadcrumb: {
type: Array,
required: false
}
}
}
</script>
<style lang="less" scoped>
.page-header{
background: #fff;
padding: 16px 32px 0;
border-bottom: 1px solid #e8e8e8;
.breadcrumb{
margin-bottom: 16px;
}
.title{
font-size: 20px;
font-weight: 500;
color: rgba(0,0,0,.85);
}
.content{
margin-bottom: 16px;
}
}
</style>