1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
| <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">
| <div v-if="logo" class="logo"><a-avatar :src="logo" /></div>
| <div class="main">
| <div class="row">
| <h1 v-if="title" class="title">{{title}}</h1>
| <div class="action"><slot name="action"></slot></div>
| </div>
| <div class="row">
| <div class="content"><slot name="content"></slot></div>
| <div class="extra"><slot name="extra"></slot></div>
| </div>
| </div>
|
| </div>
| </div>
| </template>
|
| <script>
| import ABreadcrumb from 'vue-antd-ui/es/breadcrumb'
| import AAvatar from 'vue-antd-ui/es/avatar/Avatar'
|
| const ABreadcrumbItem = ABreadcrumb.Item
| export default {
| name: 'PageHeader',
| components: {AAvatar, ABreadcrumbItem, ABreadcrumb},
| props: {
| title: {
| type: String,
| required: false
| },
| breadcrumb: {
| type: Array,
| required: false
| },
| logo: {
| type: String,
| required: false
| }
| }
| }
| </script>
|
| <style lang="less" scoped>
| .page-header{
| background: #fff;
| padding: 16px 32px 0;
| border-bottom: 1px solid #e8e8e8;
| .breadcrumb{
| margin-bottom: 16px;
| }
| .detail{
| display: flex;
| .row {
| display: flex;
| width: 100%;
| }
| .logo {
| flex: 0 1 72px;
| margin-bottom: 8px;
| & > span {
| border-radius: 72px;
| display: block;
| width: 72px;
| height: 72px;
| }
| }
| .main{
| width: 100%;
| flex: 0 1 auto;
| .title{
| flex: auto;
| font-size: 20px;
| font-weight: 500;
| color: rgba(0,0,0,.85);
| }
| .content{
| margin-bottom: 16px;
| flex: auto;
| }
| .extra{
| flex: 0 1 auto;
| margin-left: 88px;
| min-width: 242px;
| text-align: right;
| }
| .action{
| margin-left: 56px;
| min-width: 266px;
| flex: 0 1 auto;
| }
| }
| }
| }
| </style>
|
|