“如何将组件发送到树节点中的数据键?单击树中的子项时,它应该加载组件。我可以这样做吗?”

时间:2019-08-23 08:31:31

标签: angular6 treenode

我需要在我的项目中使用angular 7在其上使用treenode。在treenode中单击子级时,它应该加载一个组件。有可能吗?

我在项目中使用了primeng树结构:

"data": [{
   "label": "Visit 1",
   "data": "Documents Folder",
   "expandedIcon": "fa fa-building-o green",
   "collapsedIcon": "fa fa-building-o green",
   "selectable": false,
   "expanded": true,
   "children": [ {
       "label": "Prescreening",
       "data": "Documents Folder",
       "expandedIcon": "fa fa-briefcase gold",
       "collapsedIcon": "fa fa-briefcase gold",
       "selectable": true
   }, {
       "label": "Clinical Observations",
       "data": "Documents Folder",
       "expandedIcon": "fa fa-briefcase gold",
       "collapsedIcon": "fa fa-briefcase gold",
       "selectable": true
   }, {
       "label": "Notes",
       "data": "Documents Folder",
       "expandedIcon": "fa fa-briefcase gold",
       "collapsedIcon": "fa fa-briefcase gold",
       "selectable": true
   }, {
       "label": "Claims",
       "data": "Documents Folder",
       "expandedIcon": "fa fa-briefcase gold",
       "collapsedIcon": "fa fa-briefcase gold",
       "selectable": true
   } ]
} ]

当我单击一个孩子时(例如,如果我单击预筛选),它应该加载我的项目中已经存在的组件。

0 个答案:

没有答案