添加项目文件。
This commit is contained in:
1 parent
05e131ca4e
commit
514d6f5255
1162 files changed
+81255
No files matched your search
@@ -0,0 +1,29 @@
|
||||
using Microsoft.AspNetCore.Razor.TagHelpers;
|
||||
|
||||
namespace WalkingTec.Mvvm.TagHelpers.LayUI
|
||||
{
|
||||
|
||||
[HtmlTargetElement("wt:code", TagStructure = TagStructure.NormalOrSelfClosing)]
|
||||
public class CodeTagHelper : BaseElementTag
|
||||
{
|
||||
public new int? Height { get; set; }
|
||||
|
||||
public string Title { get; set; }
|
||||
|
||||
public override void Process(TagHelperContext context, TagHelperOutput output)
|
||||
{
|
||||
output.TagName = "pre";
|
||||
output.Attributes.SetAttribute("class", "layui-code");
|
||||
output.Attributes.SetAttribute("encode", true);
|
||||
if (Height.HasValue)
|
||||
{
|
||||
output.Attributes.SetAttribute("lay-height", $"{Height}px");
|
||||
}
|
||||
if (string.IsNullOrEmpty(Title) == false)
|
||||
{
|
||||
output.Attributes.SetAttribute("lay-title", Title);
|
||||
}
|
||||
base.Process(context, output);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user