如何在Blazor 6中多填充烟代/onmouseleave 6

发布于 2025-02-13 16:44:37 字数 166 浏览 0 评论 0原文

Events MouseEnterMouseleave不支持Blazor,.net 6。 rel =“ nofollow noreferrer”>拉动请求已合并了其实现,但目前不属于稳定版本的一部分。

如何在.NET 6中使用这些事件?

Events mouseenter and mouseleave are not supported in Blazor, .NET 6. A pull request with their implementation has been merged, but is currently not part of a stable version.

How can these events be used in .NET 6?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

九局 2025-02-20 16:44:37

解决方案是创建一个名为eventHandlers的静态类,该类可用于定义内置事件。

using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;

namespace YourApp.Client
{
    /// <summary>
    /// This is a polyfill until https://github.com/dotnet/aspnetcore/pull/40829
    /// gets released in a stable version.
    /// </summary>
    [EventHandler("onmouseleave", typeof(MouseEventArgs), true, true)]
    [EventHandler("onmouseenter", typeof(MouseEventArgs), true, true)]
    public static class EventHandlers
    {
    }
}

来源: blazor 3.1嵌套onmouseover事件

The solution is to create a static class named EventHandlers, which can be used to define built-in events.

using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;

namespace YourApp.Client
{
    /// <summary>
    /// This is a polyfill until https://github.com/dotnet/aspnetcore/pull/40829
    /// gets released in a stable version.
    /// </summary>
    [EventHandler("onmouseleave", typeof(MouseEventArgs), true, true)]
    [EventHandler("onmouseenter", typeof(MouseEventArgs), true, true)]
    public static class EventHandlers
    {
    }
}

Source: Blazor 3.1 nested onmouseover events

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文