mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-15 09:21:24 +08:00
f9b615c2ca
...for affix,back-top,breadcrumb,card,divider,typogragpy and timeline Co-authored-by: ElderJames <shunjiey@hotmail.com>
40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
using AntDesign.JsInterop;
|
|
using Microsoft.AspNetCore.Components;
|
|
using Microsoft.AspNetCore.Components.Web;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace AntDesign
|
|
{
|
|
public partial class BackTop : AntDomComponentBase
|
|
{
|
|
[Parameter]
|
|
public string Title { get; set; }
|
|
|
|
protected ClassMapper BackTopClassMapper { get; set; } = new ClassMapper();
|
|
|
|
protected ClassMapper BackTopContentClassMapper { get; set; } = new ClassMapper();
|
|
|
|
protected ClassMapper BackTopIconClassMapper { get; set; } = new ClassMapper();
|
|
|
|
protected async Task OnClick()
|
|
{
|
|
await JsInvokeAsync<DomRect>(JSInteropConstants.backTop, "BodyContainer");
|
|
}
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
SetClass();
|
|
|
|
base.OnInitialized();
|
|
}
|
|
|
|
protected void SetClass()
|
|
{
|
|
string prefixCls = "ant-back-top";
|
|
BackTopClassMapper.Add(prefixCls);
|
|
BackTopContentClassMapper.Add($"{prefixCls}-content");
|
|
BackTopIconClassMapper.Add($"{prefixCls}-icon");
|
|
}
|
|
}
|
|
}
|