1
1
<template >
2
2
<div id =" app" >
3
- <Tree
3
+ <div id =" nav" >
4
+ <router-link to =" /" >home</router-link >
5
+ <span class =" line" >|</span >
6
+ <router-link to =" /fixed-size" >fixed size</router-link >
7
+ <span class =" line" >|</span >
8
+ <router-link to =" /dynamic-size" >dynamic size</router-link >
9
+ <span class =" line" >|</span >
10
+ <router-link to =" /horizontal" >horizontal</router-link >
11
+ <span class =" line" >|</span >
12
+ <router-link to =" /infinite-loading" >infinite loading</router-link >
13
+ <span class =" line" >|</span >
14
+ <router-link to =" /keep-state" >keep state</router-link >
15
+ <span class =" line" >|</span >
16
+ <router-link to =" /page-mode" >page mode</router-link >
17
+ <span class =" line" >|</span >
18
+ <router-link to =" /chat-room" >chat room</router-link >
19
+ </div >
20
+ <router-view />
21
+
22
+ <!-- <Tree
4
23
:tree-data="demeData"
5
24
expandedAll
6
25
show-checkbox
7
26
hasHalfelEction
8
27
draggable
9
28
@on-checkbox-change="handleChangeCheckBox"
10
29
@on-checked-item="handleChangeItem">
11
- </Tree >
30
+ </Tree> -->
12
31
</div >
13
32
</template >
14
33
15
34
<script >
16
- import Tree from ' ./components/Tree/Tree'
17
- import Mock from ' ./utils/mock'
18
35
export default {
19
36
name: ' App' ,
20
- components: {
21
- Tree
22
- },
23
37
data () {
24
38
return {
25
39
visible: true ,
@@ -128,28 +142,28 @@ export default {
128
142
}
129
143
},
130
144
created () {
131
- this .genBaseData ()
145
+ // this.genBaseData()
132
146
console .log (this .baseData )
133
147
},
134
148
methods: {
135
149
toggleVisible () {
136
150
this .visible = ! this .visible
137
151
},
138
152
genBaseData () {
139
- const start = Math . round ( Math . random ())
140
- const end = start + Math . round ( Math . random () * 4 )
141
- const res = Mock . mock ({
142
- ' data|10 ' : [
143
- {
144
- ' id' : / [a-z ] {2} [A-Z ] {2} [0-9 ] / ,
145
- ' status|1' : [' success' , ' fail' ],
146
- ' tags|1-2' : [' success' , ' normal' , ' warning' , ' error' ].slice (start, end),
147
- ' time' : ' @date("yyyy-MM-dd")' ,
148
- ' name' : " @ctitle(4,6)" ,
149
- }
150
- ]
151
- })
152
- this .baseData = res .data
153
+ //
154
+ // const res = Mock.mock({
155
+ // 'data|10': [
156
+ // {const start = Math.round(Math.random())
157
+ // const end = start + Math.round(Math.random() * 4)
158
+ // 'id': /[a-z]{2}[A-Z]{2}[0-9]/,
159
+ // 'status|1': ['success', 'fail'],
160
+ // 'tags|1-2': ['success', 'normal', 'warning', 'error'].slice(start, end),
161
+ // 'time': '@date("yyyy-MM-dd")',
162
+ // 'name': "@ctitle(4,6)",
163
+ // }
164
+ // ]
165
+ // })
166
+ // this.baseData = res.data
153
167
},
154
168
handleClick (data ) {
155
169
console .log (data)
@@ -169,10 +183,11 @@ export default {
169
183
font-family : Avenir, Helvetica , Arial , sans-serif ;
170
184
-webkit-font-smoothing : antialiased ;
171
185
-moz-osx-font-smoothing : grayscale ;
172
- text-align : center ;
186
+ /* text-align: center; */
173
187
color : #2c3e50 ;
174
188
margin-top : 60px ;
175
189
}
190
+
176
191
</style >
177
192
<style lang="less">
178
193
@transition-time : .2s ;
@@ -182,6 +197,60 @@ export default {
182
197
@unimportance-color : #b7beca ;
183
198
@border-radius-small : 3px ;
184
199
200
+ #nav {
201
+ position : fixed ;
202
+ top : 0 ;
203
+ left : 0 ;
204
+ right : 0 ;
205
+ background-color : #9b4cca ;
206
+ color : #fff ;
207
+ height : 40px ;
208
+ display : flex ;
209
+ align-items : center ;
210
+ padding-left : 1em ;
211
+ white-space : nowrap ;
212
+ overflow-x : auto ;
213
+ z-index : 2 ;
214
+ @media (max-width : 640px ) {
215
+ padding : 0 ;
216
+ position : relative ;
217
+ background-color : unset ;
218
+ color : unset ;
219
+ height : unset ;
220
+ padding-left : unset ;
221
+ align-items : unset ;
222
+ }
223
+ a {
224
+ display : inline-block ;
225
+ color : #fff ;
226
+ @media (max-width : 640px ) {
227
+ margin-bottom : 0 ;
228
+ margin-right : 1em ;
229
+ color : #9b4dca ;
230
+ }
231
+ }
232
+ .line {
233
+ margin : 0 1em ;
234
+ font-size : 14px ;
235
+ color : pink ;
236
+ @media (max-width : 640px ) {
237
+ display : none ;
238
+ }
239
+ }
240
+ .router-link-exact-active ,
241
+ .router-link-exact-active :hover {
242
+ color : inherit ;
243
+ cursor : default ;
244
+ text-decoration : underline ;
245
+ @media (max-width : 640px ) {
246
+ border-bottom : 1px solid ;
247
+ border-color : #606c76 ;
248
+ text-decoration : none ;
249
+ }
250
+
251
+ }
252
+ }
253
+
185
254
.frame {
186
255
// position: absolute;
187
256
height : 300px ;
0 commit comments