a标签设置为不可用a标签没有disabled属性,所以要自己手动制作不可用状态设置颜色为灰色停用事件响应设置鼠标样式为默认样式 - 选择用的箭头样式使用ngClass为a标签设定样式<a (click)=“insertNodeSibling()” [ngClass]="{‘disableA’: brotherNodeDisabled}">新增同级</a>上面代码中disableA表示CSS中的样式类,当后面的变量brotherNodeDisabled为true时前面的样式disableA生效相反则不生效样式代码:.disableA{ pointer-events: none; cursor: default; color:gray;}更改样式:使用代码this.brotherNodeDisabled=true;修改变量的true和false,则会触发或者关闭CSS中的样式