在视图中呈现环境特定内容

你可能需要在视图中呈现某些内容,这仅适用于某些环境。要实现此目标,你可以使用 Environment 标记助手

<environment names="Development">
    <h1>This is heading for development environment</h1>
</environment>
<environment names="Staging,Production">
    <h1>This is heading for Staging or production environment</h1>
</environment>

如果当前环境与使用 names 属性指定的某个环境匹配,则 Environment 标记助手将仅呈现其内容。