右键单击无法打开上下文菜单

时间:2019-01-14 10:22:25

标签: angular primeng

通过使用primeng,当我右键单击树节点时,Contextmenu不会打开。 初始代码:-

<p-tree [value]="coaList" selectionMode="single" [(selection)]="coa" [contextMenu]="cm" (onNodeSelect)="nodeSelect($event)"></p-tree> <p-contextMenu #cm [model]="items"></p-contextMenu>

和component.ts

this.items = [
  { label: 'View', icon: 'fa fa-search', command: (event) => this.viewFile(this.coa) },
  { label: 'Unselect', icon: 'fa fa-close', command: (event) => this.viewFile(this.coa) }
];

其中component.ts中的import是:-

import { TreeNode, MenuItem } from 'primeng/api';

和模块 import { ContextMenuModule } from primeng/components/contextmenu/contextmenu';

我在做什么错?

0 个答案:

没有答案