我用Angular材质树创建了一个简单的树:
https://stackblitz.com/edit/angular-exhejg-vx5i7c?file=app/tree-dynamic-example.html
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl" >
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding >
<button mat-icon-button ></button>
{{node.item}}
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node; when: hasChild" matTreeNodePadding >
<button mat-icon-button
[attr.aria-label]="'toggle ' + node.filename" matTreeNodeToggle>
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
{{node.item + '2'}}
<mat-progress-bar *ngIf="node.isLoading"
mode="indeterminate"
class="example-tree-progress-bar"></mat-progress-bar>
</mat-tree-node>
</mat-tree>
Run Code Online (Sandbox Code Playgroud)
看起来像 :
但是,如何添加分支线?像(从这里):
我们正在编写网站逻辑,其设计是由另一家公司制作的.(他们发给我们的html文件)
但是当我们查看他们的源代码html时,我们看到:
1) modernizr.js
2)创建html5元素脚本:
<!--[if lt IE 9]>
<script>
document.createElement('header');
document.createElement('nav');
document.createElement('section');
document.createElement('article');
document.createElement('aside');
document.createElement('footer');
</script>
<![endif]-->
Run Code Online (Sandbox Code Playgroud)
3) Html5 shiv JS:
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
Run Code Online (Sandbox Code Playgroud)
4)css3-mediaqueries.js对媒体查询的引用
5) Respond.js v1.1.0 最小/最大宽度媒体查询
我对html5集成了解不多,但我认为这里有一个冗余组件.
例如,我听说modernizr 已经包含了html5 shiv提供的解决方案.
作为我想要使用的假设,我modernizr.js应该保留哪些组件?(我用数字标记每个部分,以便您更容易参考).
(ps 这个问题没有多大帮助,因为我有更多的部分)
当我运行此代码时 (under a <script> code)
window.msg = { a: 0}
var b = window.msg;
function g()
{
console.log(b)
}
msg = { a: 1};
g()
Run Code Online (Sandbox Code Playgroud)
在控制台中 - 我得到{a:0}.
这是为什么 ?我以为msg = { a: 1};会更新参考...
public class Animal
{
public Animal()
{
"animal ctor".Dump();
}
}
public class Cat :Animal
{
public Cat():this("gray")
{
"cat ctor".Dump();
}
public Cat(string c):base()
{
"cat ctor2".Dump();
}
}
void Main()
{
Cat a = new Cat();
}
Run Code Online (Sandbox Code Playgroud)
代码的输出是:
animal ctor
cat ctor2
cat ctor
Run Code Online (Sandbox Code Playgroud)
我理解第一行.
首先调用Animal Ctor,然后Cat ctor调用字符串重载public Cat(string c):base()- 但是这也是调用base的构造函数.
那么为什么我再也看不到animal ctor(:base())?