mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-05 05:27:37 +08:00
d2f95b2a07
* fix(module: Core): Remove the event listener when the component is disaposed * fix DomEventKey
33 lines
912 B
C#
33 lines
912 B
C#
// Licensed to the .NET Foundation under one or more agreements.
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace AntDesign.Core.Extensions
|
|
{
|
|
public static class ElementReferenceExtensions
|
|
{
|
|
public static string GetSelector(this ElementReference? elementReference)
|
|
{
|
|
return elementReference?.GetSelector();
|
|
}
|
|
|
|
public static string GetSelector(this ElementReference elementReference)
|
|
{
|
|
#if NET5_0_OR_GREATER
|
|
if (elementReference.Context is null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
return $"[_bl_{elementReference.Id}]";
|
|
#endif
|
|
return $"[_bl_{elementReference.Id}]";
|
|
}
|
|
}
|
|
}
|