HtmlTargetElementAttribute.TagStructure 属性

定义

预期的标记结构。 默认为 Unspecified

public:
 property Microsoft::AspNetCore::Razor::TagHelpers::TagStructure TagStructure { Microsoft::AspNetCore::Razor::TagHelpers::TagStructure get(); void set(Microsoft::AspNetCore::Razor::TagHelpers::TagStructure value); };
public Microsoft.AspNetCore.Razor.TagHelpers.TagStructure TagStructure { get; set; }
member this.TagStructure : Microsoft.AspNetCore.Razor.TagHelpers.TagStructure with get, set
Public Property TagStructure As TagStructure

属性值

注解

如果没有Unspecified其他应用于同一元素的标记帮助程序指定其TagStructureNormalOrSelfClosing行为:

<my-tag-helper></my-tag-helper>
<!-- OR -->
<my-tag-helper />

否则,如果应用于同一元素的另一个标记帮助程序指定了它们的行为,则使用该行为。

如果 WithoutEndTag HTML 元素可以采用以下格式编写:

<my-tag-helper>
<!-- OR -->
<my-tag-helper />

适用于