zoukankan      html  css  js  c++  java
  • Bootstrap Blazor 组件入门

    Bootstrap Blazor 是一套企业级 UI 组件库,适配移动端支持各种主流浏览器,已经在多个交付项目中使用。通过本套组件可以大大缩短开发周期,节约开发成本。目前已经开发、封装了 70 多个组件,欢迎有兴趣的同学试用。

    Gitee 开源地址为:https://gitee.com/LongbowEnterprise/BootstrapBlazor
    Github 开源地址为:https://github.com/ArgoZhang/BootstrapBlazor

    在线演示网站:https://www.blazor.zone

    安装指南

    项目模板

    1. 安装模板

    dotnet new -i Bootstrap.Blazor.Templates::*

    1. 使用项目模板创建新项目

    dotnet new bbapp

    bbapp 是 BootstrapBlazor App 的缩写

    1. 卸载项目模板

    dotnet new -u Bootstrap.Blazor.Templates

    现有项目中集成 BootstrapBlazor

    1. 从 Nuget.org 获取 BootstrapBlazor 包

    dotnet add package BootstrapBlazor

    1. 添加样式文件与脚本到项目文件中 Pages/_Host.cshtml (Server) or wwwroot/index.html (WebAssembly)

    HTML

    <!DOCTYPE html>
    <html lang="en">
    <head>
        . . .
        <link rel="stylesheet" href="_content/BootstrapBlazor/css/bootstrap.blazor.bundle.min.css">
    </head>
    <body>
        . . .
        <script src="_framework/blazor.server.js"></script>
        <script src="_content/BootstrapBlazor/js/bootstrap.blazor.bundle.min.js"></script>
    </body>
    </html>
    
    1. 注册服务 ~/Startup.cs

    C#

    namespace BootstrapBlazorAppName
    {
        public class Startup
        {
            public void ConfigureServices(IServiceCollection services)
            {
                //more code may be present here
                services.AddBootstrapBlazor(); 
            }
    
            //more code may be present here
        }
    }
    

    Visual Studio 插件

    安装 Visual Studio 插件

    安装包

    下载地址

    使用教程

    1. 下载安装包
    2. 解压缩安装包
    3. 安装 vsix 插件

    双击 BootstrapBlazor.UITemplate.vsix 文件,请保证 Visual Studio IDE 以及相关进程均关闭,此安装包安装过程可能很慢,请耐心等待

    特别注意

    如果长时间无响应,请查看任务管理器中是否有 devenv.exe 或者 msbuild.exe 进程,如果有请手动结束

    1. 打开 Visual Studio 2019
    1. 选中 Server 或者 WebAssembly 工程直接运行 F5
    1. 项目中按照自己需求更改页面
  • 相关阅读:
    map迭代器
    线段树——校门外的树
    并查集——C
    并查集
    数论—— LCM
    【动态规划】合唱队形
    线段树——D
    线段树——E
    逆元,exgcd,欧拉定理,费马小定理
    待学知识点
  • 原文地址:https://www.cnblogs.com/argozhang/p/BootstrapBlazor.html
Copyright © 2011-2022 走看看