在Blazor中转义@


11

我想显示Blazor组件中图标库中的图像。

路径是:

wwwroot/lib/@icon/open-iconic/icons/account-login.svg

但是@是Blazor中的特殊字符。

Answers:



10

只需添加另一个@符号。所以你的例子:

wwwroot/lib/@@icon/open-iconic/icons/account-login.svg

将呈现为:

wwwroot/lib/@icon/open-iconic/icons/account-login.svg

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.