2021-03-31 15:56:06 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
2021-03-12 17:02:11 +08:00
|
|
|
|
using Microsoft.JSInterop;
|
|
|
|
|
|
|
|
|
|
namespace AntDesign
|
|
|
|
|
{
|
|
|
|
|
public class ConfigService
|
|
|
|
|
{
|
|
|
|
|
private IJSRuntime _jS;
|
|
|
|
|
|
|
|
|
|
public ConfigService(IJSRuntime js)
|
|
|
|
|
{
|
|
|
|
|
_jS = js;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task ChangeDirection(string direction)
|
|
|
|
|
{
|
2021-03-31 15:56:06 +08:00
|
|
|
|
direction = direction?.ToLowerInvariant();
|
|
|
|
|
await _jS.InvokeVoidAsync(JSInteropConstants.SetDomAttribute, "html", new Dictionary<string, string>
|
|
|
|
|
{
|
|
|
|
|
["class"] = direction,
|
|
|
|
|
["data-direction"] = direction
|
|
|
|
|
});
|
|
|
|
|
|
2021-03-12 17:02:11 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|