soenneker/soenneker.blazor.utils.ids

GitHub: soenneker/soenneker.blazor.utils.ids

为 Blazor 组件提供轻量级、UI 一致的 ID 生成解决方案。

Stars: 0 | Forks: 0

[![](https://img.shields.io/nuget/v/soenneker.blazor.utils.ids.svg?style=for-the-badge)](https://www.nuget.org/packages/soenneker.blazor.utils.ids/) [![](https://img.shields.io/github/actions/workflow/status/soenneker/soenneker.blazor.utils.ids/publish-package.yml?style=for-the-badge)](https://github.com/soenneker/soenneker.blazor.utils.ids/actions/workflows/publish-package.yml) [![](https://img.shields.io/nuget/dt/soenneker.blazor.utils.ids.svg?style=for-the-badge)](https://www.nuget.org/packages/soenneker.blazor.utils.ids/) [![](https://img.shields.io/badge/Demo-Live-blueviolet?style=for-the-badge&logo=github)](https://soenneker.github.io/soenneker.blazor.utils.ids) [![](https://img.shields.io/github/actions/workflow/status/soenneker/soenneker.blazor.utils.ids/codeql.yml?style=for-the-badge)](https://github.com/soenneker/soenneker.blazor.utils.ids/actions/workflows/codeql.yml) # ![](https://static.pigsec.cn/wp-content/uploads/repos/cas/04/04005ae834313c22b271e0f5ffdfcc21d2ff232edf5d4f5fd2237918076c5c7f.png) Soenneker.Blazor.Utils.Ids ### 一个轻量级的 ID 生成器,用于为 Blazor 组件提供整个 UI 中一致的身份标识。 ## 安装 ``` dotnet add package Soenneker.Blazor.Utils.Ids ``` ## 设置 在 `Program.cs` 中注册服务: ``` builder.Services.AddBlazorIdGeneratorAsScoped(); ``` 在需要的地方注入高级实用程序: ``` @inject IBlazorIdGenerator Ids ``` ## 用法 在首次使用前初始化一次该包: ``` await Ids.Initialize(); ```
标签:Blazor, ID生成器, .NET, 前端开发, 工具库, 组件