abp-button tag helper improvmenets

pull/643/head
Yunus Emre Kalkan 6 years ago
parent 60c0e6b5e5
commit c083f7f326

@ -8,6 +8,8 @@
{
case AbpButtonSize.Small:
return "btn-sm";
case AbpButtonSize.Medium:
return "btn-md";
case AbpButtonSize.Large:
return "btn-lg";
case AbpButtonSize.Default:

@ -9,6 +9,8 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button
public AbpButtonSize Size { get; set; } = AbpButtonSize.Default;
public bool? Block { get; set; } = false;
public string BusyText { get; set; }
public string Text { get; set; }

@ -33,6 +33,11 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button
{
output.Attributes.AddClass(TagHelper.Size.ToClassName());
}
if (TagHelper.Block ?? false)
{
output.Attributes.AddClass("btn-block");
}
}
protected virtual void AddIcon(TagHelperContext context, TagHelperOutput output)

@ -11,6 +11,8 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button
public AbpButtonSize Size { get; set; } = AbpButtonSize.Default;
public bool? Block { get; set; } = false;
public string Text { get; set; }
public string Icon { get; set; }

@ -6,6 +6,8 @@
AbpButtonSize Size { get; }
bool? Block { get;}
string Text { get; }
string Icon { get; }

@ -70,13 +70,31 @@
<div class="demo-with-code">
<div class="demo-area">
<abp-button size="Large" text="Large" />
<abp-button size="Default" text="Default" />
<abp-button size="Small" text="Small" />
<abp-button size="Medium" text="Medium" />
<abp-button size="Large" text="Large" />
</div>
<div class="code-area">
<pre>
&lt;abp-button size=&quot;Default&quot; text=&quot;Default&quot; /&gt;
&lt;abp-button size=&quot;Small&quot; text=&quot;Small&quot; /&gt;
&lt;abp-button size=&quot;Medium&quot; text=&quot;Medium&quot; /&gt;
&lt;abp-button size=&quot;Large&quot; text=&quot;Large&quot; /&gt;
</pre>
</div>
</div>
<h4># Example</h4>
<div class="demo-with-code">
<div class="demo-area">
<abp-button block="true" text="Block" />
</div>
<div class="code-area">
<pre>
&lt;abp-button size=&quot;Large&quot; text=&quot;Large&quot;/&gt;
&lt;abp-button size=&quot;Small&quot; text=&quot;Small&quot;/&gt;
&lt;abp-button block=&quot;true&quot; text=&quot;Block&quot; /&gt;
</pre>
</div>
</div>

Loading…
Cancel
Save