init commit

This commit is contained in:
zhouyuejun
2018-10-26 11:33:25 +08:00
commit bec3bb9137
106 changed files with 29628 additions and 0 deletions
@@ -0,0 +1,34 @@
import { Component, OnInit, Input } from '@angular/core';
@Component({
selector: 'app-bar-menu',
templateUrl: './bar-menu.component.html',
styleUrls: ['./bar-menu.component.scss']
})
export class BarMenuComponent implements OnInit {
@Input() data: Array<any>;
constructor() { }
ngOnInit() {
}
/**
* 判断是否有子节点
* @param item
*/
isLeaf(item: any) {
return !item.children || !item.children.length;
}
/**
* 菜单点击事件
* @param item
*/
itemClicked(item: any) {
if (!this.isLeaf(item)) {
item.isExpend = !item.isExpend;
}
}
}