# ant-design-blazor **Repository Path**: zhihuicode/ant-design-blazor ## Basic Information - **Project Name**: ant-design-blazor - **Description**: 一套基于 Ant Design 和 Blazor 的企业级组件库 - **Primary Language**: C# - **License**: MIT - **Default Branch**: master - **Homepage**: https://antblazor.com - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 176 - **Created**: 2021-10-25 - **Last Updated**: 2024-06-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
](http://godban.github.io/browsers-support-badges/) Edge / IE | [
](http://godban.github.io/browsers-support-badges/)Firefox | [
](http://godban.github.io/browsers-support-badges/)Chrome | [
](http://godban.github.io/browsers-support-badges/)Safari | [
](http://godban.github.io/browsers-support-badges/)Opera | [
](http://godban.github.io/browsers-support-badges/)Electron |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| Edge 16 / IE 11† | 522 | 57 | 11 | 44 | Chromium 57 |
> 由于 [WebAssembly](https://webassembly.org) 的限制,Blazor WebAssembly 不支持 IE 浏览器,但 Blazor Server 支持 IE 11†。 详见[官网说明](https://docs.microsoft.com/en-us/aspnet/core/blazor/supported-platforms?view=aspnetcore-3.1&WT.mc_id=DT-MVP-5003987)。
## 💿 当前版本
- 正式发布: [](https://www.nuget.org/packages/AntDesign/)
- 每日构建: [](https://www.myget.org/feed/ant-design-blazor/package/nuget/AntDesign)
_[如何安装每日构建版本](docs/nightly-build.zh-CN.md)_
## 🎨 设计规范
与 Ant Design 设计规范定期同步,你可以在线查看[同步日志](https://github.com/ant-design-blazor/ant-design-blazor/actions?query=workflow%3A%22Style+sync+Bot%22)。
因此,你可以直接使用在 Ant Design 中的自定义主题样式。
## 📦 安装
- 先安装 [.NET Core SDK](https://dotnet.microsoft.com/download/dotnet-core/3.1?WT.mc_id=DT-MVP-5003987) 3.1.300 以上版本,推荐 .NET 5
### 从模板创建一个新项目 [](https://github.com/ant-design-blazor/ant-design-pro-blazor)
我们提供了 `dotnet new` 模板来创建一个开箱即用的 [Ant Design Pro](https://github.com/ant-design-blazor/ant-design-pro-blazor) 新项目:

- 安装模板
```bash
$ dotnet new --install AntDesign.Templates
```
- 从模板创建 Ant Design Blazor Pro 项目
```bash
$ dotnet new antdesign -o MyAntDesignApp
```
模板的参数:
| 参数 | 说明 | 类型 | 默认值 |
| ----------------- | ------------------------------------------------ | ------------------------------ | ------ |
| `-f` \| `--full` | 如果设置这个参数,会生成所有 Ant Design Pro 页面 | bool | false |
| `-ho` \| `--host` | 指定托管模型 | 'wasm' \| 'server' \| 'hosted' | 'wasm' |
| `--styles` | 指定样式构建类型 | `css` \| `less` | `css` |
| `--no-restore` | 如果设置这个参数,就不会自动恢复包引用 | bool | false |
### 在已有项目中引入 Ant Design Blazor
- 进入应用的项目文件夹,安装 Nuget 包引用
```bash
$ dotnet add package AntDesign --version
```
- 在项目中注册:
```csharp
services.AddAntDesign();
```
- 在 `wwwroot/index.html`(WebAssembly) 或 `Pages/_Host.cshtml`(Server) 中引入静态文件:
```html
```
- 在 `_Imports.razor` 中加入命名空间
```csharp
@using AntDesign
```
- 为了动态地显示弹出组件,需要在 `App.razor` 中添加一个 `
## 行为准则
本项目采用了《贡献者公约》所定义的行为准则,以明确我们社区的预期行为。
更多信息请见 [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
## ☀️ 授权协议
[](https://github.com/ant-design-blazor/ant-design-blazor/blob/master/LICENSE)
## .NET Foundation
本项目由 [.NET Foundation](https://dotnetfoundation.org) 支持。