# ant-design-blazor **Repository Path**: hikoma6709/ant-design-blazor ## Basic Information - **Project Name**: ant-design-blazor - **Description**: 一套基于 Ant Design 和 Blazor 的企业级组件库 - **Primary Language**: C# - **License**: MIT - **Default Branch**: master - **Homepage**: https://ant-design-blazor.gitee.io/ - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 176 - **Created**: 2020-12-12 - **Last Updated**: 2024-05-29 ## 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)。
## 💿 当前版本
- 正式发布: [](https://www.nuget.org/packages/AntDesign/)
- 开发构建: [](https://www.nuget.org/packages/AntDesign/)
## 🎨 设计规范
与 Ant Design 设计规范定期同步,你可以在线查看[同步日志](https://github.com/ant-design-blazor/ant-design-blazor/actions?query=workflow%3A%22Style+sync+Bot%22)。
## 📦 安装
- 先安装 [.NET Core SDK](https://dotnet.microsoft.com/download/dotnet-core/3.1) 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' |
| `--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` 中添加一个 `