嗨,我尝试使用Angular tree component,但是当我执行入门页面上描述的所有操作时,出现以下错误“属性'nodes'在'TreeViewComponent'类型上不存在。”
这是我的tree-view-component.html
<mat-tab-group>
<mat-tab label="Tree">
<tree-root [nodes]="nodes" [options]="options"></tree-root>
</mat-tab>
</mat-tab-group>
这是我的tree-view-component.ts
export class App {
nodes = [
{
id: 1,
name: 'root1',
children: [
{ id: 2, name: 'child1' },
{ id: 3, name: 'child2' }
]
},
{
id: 4,
name: 'root2',
children: [
{ id: 5, name: 'child2.1' },
{
id: 6,
name: 'child2.2',
children: [
{ id: 7, name: 'subsub' }
]
}
]
}
];
options = {};
}