javascript - 如果按钮在角度中被禁用,则禁用工具提示文本
问题描述
我是 UI 新手,我对我的 Angular 应用程序有要求,我的按钮将在某些条件下启用和禁用。我想仅在启用按钮时显示工具提示,我可以更改启用/禁用按钮上的光标类型,但想知道如何仅在启用按钮时启用工具提示文本,下面是我的代码。
<button ejs-button type="button" (click)="formulabuilder(data) [attr.disabled]="data.disable==true?'':null"
title="Formula Builder" class="formula_builder_btn">
<mat-icon role="img" class="mat-icon material-icons mat-icon-no-color"> apps</mat-icon>
</button>
.formula_builder_btn:disabled {
cursor: default;
}
.formula_builder_btn{
cursor: pointer;
}
我做错了什么吗?我怎样才能做到这一点。
解决方案
您可以有条件地添加标题
<button ejs-button type="button" title="{{ data.disable? '' : 'Formula Builder'}}">
推荐阅读
- python - NameError:名称“文件”未定义。在使用 tkinter 线程时
- powershell - 未为 PS Core RunspacePool 调用 InitialSessionState 中的 StartupScripts
- pandas - Pandas 数据框将特征划分为高相关性组
- java - 如何将数据从 DATA 类中的方法发送到 guiTest 类中的 jTextArea
- ruby-on-rails - 数组作为 Rails.cache.fetch 方法中的第一个参数
- scala - 你能在 Scala 中拥有一系列案例对象吗?
- c++ - R_X86_64_PLT32的地址是怎么计算的?
- dialogflow-es - 避免在 Dialogflow 中将货币转录为符号
- android - Android 的 TMemo (Firemonkey) 问题和奇怪的行为
- azure - 如何设置 Azure Pipeline,使其在推送到 github 后自动更新和构建?