-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathApp.vue
128 lines (116 loc) · 2.31 KB
/
App.vue
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<script>
import { Container, Aside, Main, Header } from 'element-ui'
import { startCase } from 'lodash'
export default {
props: {
sidebar: {
type: Boolean,
default: true,
},
},
data() {
return {
routes: [
'BasicForm',
'InlineValidatorsForm',
'AsyncSubmitForm',
'ImmediateForm',
'SyncValidationForm',
'AllValidationsForm',
'ArrayFieldForm',
'UploadForm',
'DynamicValidatorsForm',
'ScopedSlotForm',
'NoFieldsForm',
],
}
},
computed: {
routeName() {
return this.$route.name
},
},
render() {
return (
<Container direction="vertical" class="root-container">
<Header class="header" height="80px">
<pre class="title">@detools/vue-form</pre>
</Header>
<Container class="main-container">
<Aside class="aside" width="250px">
{this.routes.map(name => (
<router-link class={['link', { link_active: name === this.routeName }]} to={{ name }}>
{startCase(name)}
</router-link>
))}
</Aside>
<Container direction="vertical">
<Main class="main">
<router-view />
</Main>
</Container>
</Container>
</Container>
)
},
}
</script>
<style scoped lang="less">
.root-container {
min-height: 100%;
padding-top: 80px;
padding-left: 250px;
}
.header {
height: 80px;
box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.2);
position: fixed;
top: 0;
right: 0;
left: 0;
background-color: #ffffff;
z-index: 1;
}
.title {
font-size: 40px;
margin: 10px 0 0;
font-weight: bold;
}
.main-container {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: stretch;
}
.aside {
position: fixed;
width: 250px;
top: 80px;
left: 0;
bottom: 0;
border-right: 1px solid rgba(0, 0, 0, 0.1);
}
.main {
padding: 10px 40px 40px;
}
.link {
display: block;
line-height: 40px;
padding-left: 30px;
position: relative;
color: #0a0a0a;
&_active {
&:before {
content: '☛';
position: absolute;
display: block;
width: 10px;
height: 10px;
top: -3px;
left: 5px;
color: black;
font-size: 20px;
}
}
}
</style>