a标签禁用

 <a [disabled]="true">链接a>

以上写法不能实现a标签禁用功能

Can't bind to 'disabled' since it isn't a known property of 'a'.

正确写法:

<a href="javascript:void(0)" [ngClass]="{'disabled': isDisabled}">链接a>

href一定要加,不加实现不了置灰

a标签禁用_第1张图片

a.disabled {
  color: gray;
  cursor: not-allowed;
  pointer-events: none;
  text-decoration: none;
}

你可能感兴趣的:(java,html,css)