以及组件中:
myFunction() { console.log("Button clicked!"); }
button:hover { cursor: not-allowed; }
可以将其修改为:
button:not(:disabled):hover { cursor: pointer; }
参考示例:
模板:
组件:
import { Component } from '@angular/core';
@Component({ selector: 'app-my-button', templateUrl: './my-button.component.html', styleUrls: ['./my-button.component.css'] }) export class MyButtonComponent { myClick() { console.log("按钮点击了!"); } }
上一篇:按钮未呈现,只显示代码
下一篇:按钮未出现