Skip to content

Commit 2cf8af4

Browse files
authored
doc(Readme): update component readme (#5608)
* doc: 更新组件 nuget readme 文档 * doc: 微调颜色
1 parent 6b4b5ae commit 2cf8af4

File tree

3 files changed

+52
-83
lines changed

3 files changed

+52
-83
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ English | <a href="README.zh-CN.md">中文</a>
2020
<p>This project is part of the <a href="https://www.dotnetfoundation.org/">.NET Foundation</a> and operates under their <a href="https://www.dotnetfoundation.org/code-of-conduct">code of conduct</a>. </p>
2121

2222
## Online Examples
23-
[![website](https://img.shields.io/badge/site-https://www.blazor.zone-success.svg?color=green&logo=buzzfeed&logoColor=red)](https://www.blazor.zone)
23+
[![website](https://img.shields.io/badge/online-https://www.blazor.zone-success.svg?color=&logo=buzzfeed&logoColor=green)](https://www.blazor.zone)
2424

2525
## Environment
2626

README.zh-CN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,20 +126,20 @@ dotnet new install Bootstrap.Blazor.Templates::*
126126

127127
## QQ交流群
128128

129-
[![QQ](https://img.shields.io/badge/QQ-795206915-green.svg?logo=tencent%20qq&logoColor=red)](https://qm.qq.com/cgi-bin/qm/qr?k=1-jF9-5WA_3GFiJgXem2U_AQfqbdyOlV&jump_from=webapi) [![QQ](https://img.shields.io/badge/QQ-675147445-green.svg?logo=tencent%20qq&logoColor=red)](https://qm.qq.com/cgi-bin/qm/qr?k=Geker7hCXK0HC-J8_974645j_n6w0OE0&jump_from=webapi)
129+
[![QQ](https://img.shields.io/badge/QQ-795206915-greenlight.svg?logo=tencent%20qq&logoColor=red)](https://qm.qq.com/cgi-bin/qm/qr?k=1-jF9-5WA_3GFiJgXem2U_AQfqbdyOlV&jump_from=webapi) [![QQ](https://img.shields.io/badge/QQ-675147445-greenlight.svg?logo=tencent%20qq&logoColor=red)](https://qm.qq.com/cgi-bin/qm/qr?k=Geker7hCXK0HC-J8_974645j_n6w0OE0&jump_from=webapi)
130130

131131
## 视频教程
132132

133133
B 站视频集锦 [传送门](https://space.bilibili.com/660853738/channel/index)
134134

135135
## 演示地址
136-
[![website](https://img.shields.io/badge/site-https://www.blazor.zone-success.svg?color=green&logo=buzzfeed&logoColor=red)](https://www.blazor.zone)
136+
[![website](https://img.shields.io/badge/online-https://www.blazor.zone-success.svg?color=greenlight&logo=buzzfeed&logoColor=green)](https://www.blazor.zone)
137137

138138
## GVP 奖杯
139139
![项目奖杯](https://images.gitee.com/uploads/images/2021/0112/120620_e596ac3c_554725.png "GVP.png")
140140

141141
## 开源协议
142-
[![Gitee license](https://img.shields.io/github/license/dotnetcore/BootstrapBlazor.svg?logo=git&logoColor=red)](https://gitee.com/LongbowEnterprise/BootstrapBlazor/blob/master/LICENSE)
142+
[![Gitee license](https://img.shields.io/github/license/dotnetcore/BootstrapBlazor.svg?logo=git&color=&logoColor=green)](https://gitee.com/LongbowEnterprise/BootstrapBlazor/blob/master/LICENSE)
143143

144144
## 特别鸣谢
145145

src/BootstrapBlazor/readme.md

Lines changed: 48 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -2,110 +2,79 @@
22

33
## an enterprise-level UI component library based on Bootstrap and Blazor.
44

5-
<h4>This project is part of the <a href="https://www.dotnetfoundation.org/">.NET Foundation</a> and operates under their <a href="https://www.dotnetfoundation.org/code-of-conduct">code of conduct</a>. </h4>
5+
This project is part of the [.NET Foundation](https://www.dotnetfoundation.org/) and operates under their [Code Of Conduct](https://www.dotnetfoundation.org/code-of-conduct)
66

7-
[![License](https://img.shields.io/github/license/dotnetcore/bootstrapblazor.svg?logo=git&logoColor=red)](https://github.com/dotnetcore/BootstrapBlazor/blob/main/LICENSE)
7+
[![License](https://img.shields.io/github/license/dotnetcore/bootstrapblazor.svg?logo=git&logoColor=red&color=)](https://github.com/dotnetcore/BootstrapBlazor/blob/main/LICENSE)
88
[![Github build](https://img.shields.io/github/actions/workflow/status/dotnetcore/BootstrapBlazor/build.yml?branch=main&?label=main&logo=github)](https://github.com/dotnetcore/BootstrapBlazor/actions?query=workflow%3A%22Build+Project%22+branch%3Amain)
99
[![Repo Size](https://img.shields.io/github/repo-size/dotnetcore/BootstrapBlazor.svg?logo=github&logoColor=green&label=repo)](https://github.com/dotnetcore/BootstrapBlazor)
1010
[![Commit Date](https://img.shields.io/github/last-commit/dotnetcore/BootstrapBlazor/main.svg?logo=github&logoColor=green&label=commit)](https://github.com/dotnetcore/BootstrapBlazor)
1111
[![codecov](https://codecov.io/gh/dotnetcore/BootstrapBlazor/branch/main/graph/badge.svg?token=5SXIWHXZC3)](https://codecov.io/gh/dotnetcore/BootstrapBlazor)
1212

1313
---
1414

15-
## Features
16-
- Enterprise-class UI designed for web applications.
17-
- A set of high-quality Blazor components out of the box.
18-
- Supports WebAssembly-based client-side and SignalR-based server-side UI event interaction.
19-
- Supports Progressive Web Applications (PWA).
20-
- Build with C#, a multi-paradigm static language for an efficient development experience.
21-
- .NET Standard 2.1 based, with direct reference to the rich .NET ecosystem.
22-
- Supports NET5. (Server-Side, WASM)
23-
- Seamless integration with existing ASP.NET Core MVC and Razor Pages projects.
24-
2515
## Online Examples
26-
[![website](https://img.shields.io/badge/China-https://www.blazor.zone-success.svg?color=blue&logo=buzzfeed&logoColor=green)](https://www.blazor.zone)
27-
28-
## Installation Guide
16+
[![website](https://img.shields.io/badge/online-https://www.blazor.zone-success.svg?&logo=buzzfeed&logoColor=green)](https://www.blazor.zone)
2917

30-
- Install .net core sdk [Official website](https://dotnet.microsoft.com/download?wt.mc_id=DT-MVP-5004174)
31-
- Install Visual Studio latest [Official website](https://visualstudio.microsoft.com/vs/getting-started?wt.mc_id=DT-MVP-5004174)
18+
## Quick Installation Guide
3219

33-
```shell
34-
git clone https://github.com/dotnetcore/BootstrapBlazor.git
35-
cd BootstrapBlazor/src/BootstrapBlazor.Server
36-
dotnet run
20+
### Install Package
21+
```
22+
dotnet add package BootstrapBlazor
3723
```
3824

39-
## Create a new project from the dotnet new template
40-
41-
1. Install the template
42-
43-
`dotnet new install Bootstrap.Blazor.Templates::*`
44-
45-
2. Create the Boilerplate project with the template
46-
47-
`dotnet new bbapp`
48-
49-
## Install Bootstrap Blazor Project Template
50-
51-
1. Download Project Template
52-
53-
Microsoft Market [link](https://marketplace.visualstudio.com/items?itemName=Longbow.BootstrapBlazorUITemplate&wt.mc_id=DT-MVP-5004174)
54-
55-
2. Double Click **BootstrapBlazor.UITemplate.vsix**
25+
### Add the following to `_Imports.razor`
26+
```
27+
@using BootstrapBlazor.Components
28+
```
5629

57-
## Import Bootstrap Blazor into an existing project
30+
### Add the following to the `MainLayout.razor`
31+
```html
32+
<BootstrapBlazorRoot>
33+
@Body
34+
</BootstrapBlazorRoot>
35+
```
5836

59-
1. Go to the project folder of the application and install the Nuget package reference
37+
### Add the following to your HTML head section
38+
it's either **index.html** or **_Layout.cshtml/_Host.cshtml/App.razor** depending on whether you're running WebAssembly or Server
39+
```html
40+
<link rel="stylesheet" href="_content/BootstrapBlazor/css/bootstrap.blazor.bundle.min.css" />
41+
```
6042

61-
`dotnet add package BootstrapBlazor`
43+
### Add the following script at the end of the body
44+
```html
45+
<script src="_content/BootstrapBlazor/js/bootstrap.blazor.bundle.min.js"></script>
46+
```
6247

63-
2. **Add** the `stylesheet` `javascripts` file to your main index file - `Pages/_Host.cshtml (Server)` or `wwwroot/index.html (WebAssembly)`
48+
### Add the following to the relevant sections of `Program.cs`
49+
```csharp
50+
builder.Services.AddBootstrapBlazor();
51+
```
6452

65-
**HTML**
53+
## Usage
54+
```razor
55+
<Display Value="@_text"></Display>
56+
<Button Text="Button" OnClick="@ClickButton"></Button>
57+
58+
@code {
59+
private string? _text;
60+
private void ClickButton(MouseEventArgs e)
61+
{
62+
_text = DateTime.Now.ToString();
63+
}
64+
}
65+
```
6666

67+
## Install CLI Template
68+
1. Install the template
6769
```
68-
<!DOCTYPE html>
69-
<html lang="en">
70-
<head>
71-
. . .
72-
<link rel="stylesheet" href="_content/BootstrapBlazor/css/bootstrap.blazor.bundle.min.css">
73-
</head>
74-
<body>
75-
. . .
76-
<script src="_content/BootstrapBlazor/js/bootstrap.blazor.bundle.min.js"></script>
77-
</body>
78-
</html>
70+
dotnet new install Bootstrap.Blazor.Templates::*
7971
```
8072

81-
3. Open the `Program.cs` file in the and register the `Bootstrap Blazor` service:
82-
83-
**C#**
84-
73+
2. Create the Boilerplate project with the template
8574
```
86-
builder.Services.AddBootstrapBlazorServices();
75+
dotnet new bbapp
8776
```
8877

89-
## Visual Studio Integration
90-
91-
To create a new `Bootstrap Blazor` UI for Blazor application, use the Create New Project Wizard. The wizard detects all installed versions of `Bootstrap Blazor` for Blazor and lists them in the Version combobox—this enables you to start your project with the desired version. You can also get the latest version to make sure you are up to date.
92-
93-
1. Get the Wizard
94-
95-
To use the Create New Project Wizard, install the `Bootstrap Blazor` UI for Blazor Visual Studio Extensions. You can get it from the:
96-
97-
- Visual Studio Marketplace (for Windows)
98-
99-
2. Start the Wizard
100-
101-
To start the wizard, use either of the following approaches
102-
103-
### Using the Project menu:
104-
105-
- Click File > New > Project.
106-
- Find and click the C# Blazor Application option (you can use the search, or filter by Blazor templates).
107-
- Follow the wizard.
108-
10978
## Code of conduct
11079

11180
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.

0 commit comments

Comments
 (0)