首页 > 解决方案 > 更改 clr-dg-placeholder 图标或背景图片

问题描述

我正在使用 clr-dg-placeholder 在 Clarity Datagrid 中设置占位符,但我想更改背景图像或图标。 在此处输入图像描述

没有css可以吗?

标签: vmware-clarity

解决方案


您将不得不关闭其中包含数据网格并且还需要覆盖的组件的视图封装。

从'@angular/core'导入{组件,ViewEncapsulation};

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: [ './app.component.css' ],
  encapsulation: ViewEncapsulation.None,
})
export class AppComponent  {}

然后你可以.datagrid-placeholder-image直接定位元素并覆盖background-image属性

.datagrid-host .datagrid .datagrid-table .datagrid-placeholder-container .datagrid-placeholder-image{
  background-image: url('data:image/svg+xml;utf8,<svg height="100px" width="100px">YOUR SVG CODE HERE</svg>');
} 

是一个正在运行的带有覆盖的堆栈闪电战。


推荐阅读