[英]Why does Visual Studio highlight double curly braces in Razor (.cshtml/.razor)?
Although I have been working with Razor pages( .cshtml
) and Razor components( .razor
) in Blazor for a while in Visual Studio 2019, I did not stumble upon this feature up until now where it highlights anything between two pairs of braces: {{ }}
. Although I have been working with Razor pages( .cshtml
) and Razor components( .razor
) in Blazor for a while in Visual Studio 2019, I did not stumble upon this feature up until now where it highlights anything between two pairs of braces: {{ }}
。
It does it for both Razor pages( .cshtml
) and Razor components( .razor
).它适用于 Razor 页面( .cshtml
)和 Razor 组件( .razor
)。 There is no mention of such syntax in the Razor syntax documentation . Razor 语法文档中没有提到这种语法。 What purpose was the {{}}
syntax intended to serve? {{}}
语法的目的是什么? What am I missing?我错过了什么?
This is what it looks like.这就是它的样子。 The text is highlighted in hot pink:文本以亮粉色突出显示:
This is what the same highlight looks like in the light theme:这是浅色主题中相同的亮点:
This is mapped by the "HTML Client Template Value" setting in Tools|Options.这由工具|选项中的“HTML 客户端模板值”设置映射。
It is a piece of HTML syntax used in ao Angular for data-binding,它是一段 HTML 语法在 ao Angular 中用于数据绑定,
like <h1> {{user.username}} </h1>
.像<h1> {{user.username}} </h1>
。 Comparable to Blazor's yellow @
堪比 Blazor 的黄色@
I don't think this has any meaning in a Blazor (razor) file.我认为这在 Blazor(剃刀)文件中没有任何意义。 Safe to ignore.安全忽略。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.