ng-alain / ng-alain

NG-ZORRO admin panel front-end framework (surge mirror https://ng-alain-doc.surge.sh)
https://ng-alain.com
MIT License
4.54k stars 1.16k forks source link

g2-card的total属性,文档中标注了支持html,实际未支持。 #2206

Closed xingkoo closed 2 years ago

xingkoo commented 2 years ago

Reproduction link

https://github.com/ng-alain/delon/blob/9461b3b373d5a66aa0e80eaddc2747e9653f4062/packages/chart/card/card.component.html#L16

Steps to reproduce

如上链接,原代码中未对字符串进行safe处理。

What is expected?

可以调整显示统计数量的样式。通过设置html或者增加style、class都可以。

What is actually happening?

不能使用html

Environment Info
ng-alain 13.3.0
Browser chrome
alain-bot[bot] commented 2 years ago

Translation of this issue:

G2-card's Total property, the document is marked with the support HTML, actually not supported.

reproduction link

[https://github.com/ng-alain/delon/blob/9461b3b373d5a66aa0e80Eaddc2747e9653f4062/packages/Chart/card/card.component.html#l16] (https://github.com/ng-alain/delon/blob/NG-alain/Delon/blob/ 9461B3B373D5A66AA0E80EADDC2747E9653F4062 / packages / chart / card / card.component.html # l16)

steps to reproduce

As the above link, the string is not processed in the original code.

What is expected?

You can adjust the style of the statistical quantity. By setting HTML or adding Style, Class can.

What is actually happens?

No HTML

ENVIRONMENT INFO
NG-alain 13.3.0
Browser Chrome
cipchk commented 2 years ago

试一下:


:host {
  ::ng-deep {
    .g2-card__total { color: #f50; }
  }
}
xingkoo commented 2 years ago

需要条件判断决定是否高亮显示。我已在外部增加条件判断控制父级的样式类,来达到这个目的。 但是有些繁琐。最好是能直接实际html支持,或者给到一个表达式来控制样式的方法。