From c7349c836dca35cdf25bcc336197319ba0e4748d Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 12 Mar 2025 11:02:08 +0800 Subject: [PATCH 1/2] =?UTF-8?q?doc:=20=E6=9B=B4=E6=96=B0=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=20nuget=20readme=20=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/readme.md | 127 +++++++++++++--------------------- 1 file changed, 48 insertions(+), 79 deletions(-) diff --git a/src/BootstrapBlazor/readme.md b/src/BootstrapBlazor/readme.md index faccb6dad24..f7133edc70e 100644 --- a/src/BootstrapBlazor/readme.md +++ b/src/BootstrapBlazor/readme.md @@ -2,9 +2,9 @@ ## an enterprise-level UI component library based on Bootstrap and Blazor. -

This project is part of the .NET Foundation and operates under their code of conduct.

+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) -[![License](https://img.shields.io/github/license/dotnetcore/bootstrapblazor.svg?logo=git&logoColor=red)](https://github.com/dotnetcore/BootstrapBlazor/blob/main/LICENSE) +[![License](https://img.shields.io/github/license/dotnetcore/bootstrapblazor.svg?logo=git&logoColor=red&color=)](https://github.com/dotnetcore/BootstrapBlazor/blob/main/LICENSE) [![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) [![Repo Size](https://img.shields.io/github/repo-size/dotnetcore/BootstrapBlazor.svg?logo=github&logoColor=green&label=repo)](https://github.com/dotnetcore/BootstrapBlazor) [![Commit Date](https://img.shields.io/github/last-commit/dotnetcore/BootstrapBlazor/main.svg?logo=github&logoColor=green&label=commit)](https://github.com/dotnetcore/BootstrapBlazor) @@ -12,100 +12,69 @@ --- -## Features -- Enterprise-class UI designed for web applications. -- A set of high-quality Blazor components out of the box. -- Supports WebAssembly-based client-side and SignalR-based server-side UI event interaction. -- Supports Progressive Web Applications (PWA). -- Build with C#, a multi-paradigm static language for an efficient development experience. -- .NET Standard 2.1 based, with direct reference to the rich .NET ecosystem. -- Supports NET5. (Server-Side, WASM) -- Seamless integration with existing ASP.NET Core MVC and Razor Pages projects. - ## Online Examples -[![website](https://img.shields.io/badge/China-https://www.blazor.zone-success.svg?color=blue&logo=buzzfeed&logoColor=green)](https://www.blazor.zone) - -## Installation Guide +[![website](https://img.shields.io/badge/online-https://www.blazor.zone-success.svg?&logo=buzzfeed&logoColor=green)](https://www.blazor.zone) -- Install .net core sdk [Official website](https://dotnet.microsoft.com/download?wt.mc_id=DT-MVP-5004174) -- Install Visual Studio latest [Official website](https://visualstudio.microsoft.com/vs/getting-started?wt.mc_id=DT-MVP-5004174) +## Quick Installation Guide -```shell -git clone https://github.com/dotnetcore/BootstrapBlazor.git -cd BootstrapBlazor/src/BootstrapBlazor.Server -dotnet run +### Install Package +``` +dotnet add package BootstrapBlazor ``` -## Create a new project from the dotnet new template - -1. Install the template - -`dotnet new install Bootstrap.Blazor.Templates::*` - -2. Create the Boilerplate project with the template - -`dotnet new bbapp` - -## Install Bootstrap Blazor Project Template - -1. Download Project Template - -Microsoft Market [link](https://marketplace.visualstudio.com/items?itemName=Longbow.BootstrapBlazorUITemplate&wt.mc_id=DT-MVP-5004174) - -2. Double Click **BootstrapBlazor.UITemplate.vsix** +### Add the following to `_Imports.razor` +``` +@using BootstrapBlazor.Components +``` -## Import Bootstrap Blazor into an existing project +### Add the following to the `MainLayout.razor` +```html + + @Body + +``` -1. Go to the project folder of the application and install the Nuget package reference +### Add the following to your HTML head section +it's either **index.html** or **_Layout.cshtml/_Host.cshtml/App.razor** depending on whether you're running WebAssembly or Server +```html + +``` -`dotnet add package BootstrapBlazor` +### Add the following script at the end of the body +```html + +``` -2. **Add** the `stylesheet` `javascripts` file to your main index file - `Pages/_Host.cshtml (Server)` or `wwwroot/index.html (WebAssembly)` +### Add the following to the relevant sections of `Program.cs` +```csharp +builder.Services.AddBootstrapBlazor(); +``` - **HTML** +## Usage +```razor + + + +@code { + private string? _text; + private void ClickButton(MouseEventArgs e) + { + _text = DateTime.Now.ToString(); + } +} +``` +## Install CLI Template +1. Install the template ``` - - - - . . . - - - - . . . - - - +dotnet new install Bootstrap.Blazor.Templates::* ``` -3. Open the `Program.cs` file in the and register the `Bootstrap Blazor` service: - - **C#** - +2. Create the Boilerplate project with the template ``` -builder.Services.AddBootstrapBlazorServices(); +dotnet new bbapp ``` -## Visual Studio Integration - -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. - -1. Get the Wizard - -To use the Create New Project Wizard, install the `Bootstrap Blazor` UI for Blazor Visual Studio Extensions. You can get it from the: - -- Visual Studio Marketplace (for Windows) - -2. Start the Wizard - -To start the wizard, use either of the following approaches - -### Using the Project menu: - -- Click File > New > Project. -- Find and click the C# Blazor Application option (you can use the search, or filter by Blazor templates). -- Follow the wizard. - ## Code of conduct This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. From 9647b970c7349ebacc57c9d524de049d909d762c Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 12 Mar 2025 11:02:18 +0800 Subject: [PATCH 2/2] =?UTF-8?q?doc:=20=E5=BE=AE=E8=B0=83=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- README.zh-CN.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 79a3c9cf101..40fa70bd8a6 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ English | 中文

This project is part of the .NET Foundation and operates under their code of conduct.

## Online Examples -[![website](https://img.shields.io/badge/site-https://www.blazor.zone-success.svg?color=green&logo=buzzfeed&logoColor=red)](https://www.blazor.zone) +[![website](https://img.shields.io/badge/online-https://www.blazor.zone-success.svg?color=&logo=buzzfeed&logoColor=green)](https://www.blazor.zone) ## Environment diff --git a/README.zh-CN.md b/README.zh-CN.md index b49ade2959d..ecb396d3464 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -126,20 +126,20 @@ dotnet new install Bootstrap.Blazor.Templates::* ## QQ交流群 -[![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) +[![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) ## 视频教程 B 站视频集锦 [传送门](https://space.bilibili.com/660853738/channel/index) ## 演示地址 -[![website](https://img.shields.io/badge/site-https://www.blazor.zone-success.svg?color=green&logo=buzzfeed&logoColor=red)](https://www.blazor.zone) +[![website](https://img.shields.io/badge/online-https://www.blazor.zone-success.svg?color=greenlight&logo=buzzfeed&logoColor=green)](https://www.blazor.zone) ## GVP 奖杯 ![项目奖杯](https://images.gitee.com/uploads/images/2021/0112/120620_e596ac3c_554725.png "GVP.png") ## 开源协议 -[![Gitee license](https://img.shields.io/github/license/dotnetcore/BootstrapBlazor.svg?logo=git&logoColor=red)](https://gitee.com/LongbowEnterprise/BootstrapBlazor/blob/master/LICENSE) +[![Gitee license](https://img.shields.io/github/license/dotnetcore/BootstrapBlazor.svg?logo=git&color=&logoColor=green)](https://gitee.com/LongbowEnterprise/BootstrapBlazor/blob/master/LICENSE) ## 特别鸣谢