我做了一些与Ng2-Smart-Table相关的编码。当我做自定义按钮实现时,用户体验很差,因此我想在将鼠标悬停到这些按钮中时添加工具提示。有没有人有过这样做的经验?
我当前的代码与动作列相关如下
custom: [
{ name: "healrecord", title: '<i class="nb-plus-circled"></i>' },
{ name: "terminaterecord", title: '<i class="nb-power"></i>' },
{
name: "stoprecord",
title: '<i class="nb-square"></i>',
},
{
name: "viewrecord",
title: '<i class="nb-list"></i>',
},
{ name: "editrecord", title: '<i class="nb-edit"></i>' },
{ name: "deleterecord", title: '<i class="nb-trash"></i>' },
],
},

发布于 2021-04-01 13:34:35
在uou在前端调用的循环中,你必须像这样调用:
[matTooltip]= {{ custom.name }}你必须放置你想要显示为工具提示的变量。这里我以custom.name为例进行了说明。如果你想将标题显示为工具提示,你必须编写custom.title。
我建议您将数组名称更改为customs。你可以这样调用:
<ng-container *ngFor="let custom of customs">
[matTooltip]= {{ custom.name }}
</ng-container>https://stackoverflow.com/questions/66898693
复制相似问题