File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ export default {
17
17
id: 1 ,
18
18
name: " 音乐" ,
19
19
children: []
20
+ },{
21
+ id: 220 ,
22
+ name: " 游戏" ,
23
+ children: [],
24
+ path: " http://www.baidu.com"
20
25
},{
21
26
id: 2 ,
22
27
name: " 视频" ,
Original file line number Diff line number Diff line change @@ -241,11 +241,13 @@ export default{
241
241
242
242
// 根判断
243
243
if (this .root == ' 0' ){
244
+
244
245
strRootClass = (this .num == 0 && ! this .model .children ) ? " roots_docu" : (this .nodes == 1 ) || (this .num == 0 && this .nodes != this .num + 1 ) ?
245
- " root_" : (this .nodes == this .num + 1 ) ? " bottom_" : " center_"
246
+ " root_" : (this .nodes == this .num + 1 ) ? " bottom_" : " center_" ;
246
247
247
248
// 子树判断
248
249
}else if (this .root == ' 1' ) {
250
+
249
251
strRootClass = this .nodes > 1 && this .model .children && this .nodes != this .num + 1
250
252
? " center_" :
251
253
(this .num == 0 && this .nodes > 1 ) || (this .nodes != this .num + 1 ) ? " center_docu" :
@@ -260,16 +262,20 @@ export default{
260
262
},
261
263
// 展开/收起
262
264
prefixClass : function (){
263
- console .log (this .rootClass );
264
-
265
265
var returnChar = " " ;
266
+
266
267
if (this .rootClass .indexOf (" docu" )== - 1 ){
267
268
if (this .model .isFolder ){
268
- returnChar = " open" ;
269
+ returnChar = " open" ;
269
270
}else {
270
- returnChar = ' close'
271
- }
271
+ returnChar = ' close' ;
272
+ }
272
273
}
274
+
275
+ if (! this .model .children && this .rootClass .indexOf (" docu" )== - 1 ){
276
+ returnChar = ' docu' ;
277
+ }
278
+
273
279
return returnChar;
274
280
}
275
281
},
You can’t perform that action at this time.
0 commit comments