一套基于 Ant Design 和 Blazor 的企业级组件库
Firefox 522
Chrome 57
Safari 11
Opera 44
Edge 16
IE 11
Electron Chromium 57
与 Ant Design 设计规范定期同步
$ dotnet new blazorwasm -o MyAntDesignApp
$ cd MyAntDesignApp
$ dotnet add package AntDesign --version
<link href="_content/AntDesign/css/ant-design-blazor.css" rel="stylesheet" />
<script src="_content/AntDesign/js/ant-design-blazor.js"></script>
@using AntDesign
<Router AppAssembly="@typeof(MainLayout).Assembly">
<Found Context="routeData">
<RouteView RouteData="routeData" DefaultLayout="@typeof(MainLayout)" />
</Found>
<NotFound>
<LayoutView Layout="@typeof(MainLayout)">
<Result Status="404" />
</LayoutView>
</NotFound>
</Router>
<AntContainer /> <-- 在这里添加 ?
<Button type="primary">Hello World!</Button>
国内源码地址:https://gitee.com/ant-design-blazor/ant-design-blazor
国外源码地址:https://github.com/ant-design-blazor/ant-design-blazor
最后希望大家多多评论、关注、点赞、转发,你们的支持,是我更新下去的最大动力。
注于Java领域优质技术号,欢迎关注
作者:SevDot
Web 开发中几乎的平台都需要一个后台管理,但是从零开发一套后台控制面板并不容易,幸运的是有很多开源免费的后台控制面板可以给开发者使用,那么有哪些优秀的开源免费的控制面板呢?我在 Github 上收集了一些优秀的后台控制面板,并总结得出 Top 10。
Github Star 数 24969 , Github 地址:https://github.com/almasaeed2010/AdminLTE。
非常流行的基于 Bootstrap 3.x 的免费的后台 UI 框架。
Github Star 数 19546, Github 地址: https://github.com/PanJiaChen/vue-element-admin。
一个基于 vue2.0 和 Eelement 的控制面板 UI 框架。
Github Star 数 15870, Github 地址:https://github.com/tabler/tabler。
构建在 BootStrap 4 之上的免费的 HTML 控制面板框架
Github Star 数 15654, Github 地址:https://github.com/puikinsh/gentelella。
一个基于 Bootstarp 的免费的后台控制面板。
Github Star 数 13181, Github 地址:https://github.com/akveo/ngx-admin。
基于 Angular 2, Bootstrap 4 和 Webpack 的后台管理面板框架。
Github Star 数 12707,Github 地址:https://github.com/ant-design/ant-design-pro。
开箱即用的中台前端/设计解决方案
Github Star 数 9241,Github 地址:https://github.com/akveo/blur-admin。
基于 Angular 和 Bootstrap 的后台管理面板框架。
Github Star 数 8676,Github 地址:https://github.com/vue-bulma/vue-admin。
基于 Vue 和 Bulma 的控制面板。
Github Star 数 8668,Github 地址:https://github.com/iview/iview-admin。
基于 iView 的 Vue 2.0 控制面板。
Github Star 数 7111,Github 地址:https://github.com/creativetimofficial/material-dashboard。
基于 Bootstrap 4 和 Material 风格的控制面板。
链接:https://www.jianshu.com/p/3bc7404af887
一文掌握:在Vite中高效运用Ant Design Vue3.x进行现代化UI开发实践
引言
随着Vue3.x框架的发布和普及,以及Vite作为新一代前端构建工具的崛起,现代化UI开发已经进入了新的篇章。本文将深入探讨如何在Vite环境中高效运用Ant Design Vue3.x进行项目实践,从而提升开发效率和用户体验。
1. Vite简介与环境搭建
bash
npm install -g create-vue
create-vue my-project --template vue
cd my-project
2. 安装并引入Ant Design Vue3.x
javascript
import { createApp } from 'vue';
import App from './App.vue';
import Antd from 'ant-design-vue';
const app=createApp(App);
app.use(Antd);
app.mount('#app');
在已创建的Vite项目中集成Ant Design Vue3.x,执行以下命令:
3. 配置主题与按需加载
javascript
import Components from 'unplugin-vue-components/vite'
import AutoImport from 'unplugin-auto-import'
export default {
plugins: [
Components({
dirs: ['node_modules/ant-design-vue'],
resolvers: [AntDesignVueResolver()],
}),
AutoImport({
imports: ['ant-design-vue'],
}),
],
}
4. 使用Ant Design Vue3.x组件实战
vue
<template>
<a-layout>
<a-layout-header>Header</a-layout-header>
<a-layout-content>
<a-button type="primary">Hello, World!</a-button>
</a-layout-content>
<a-layout-footer>Footer</a-layout-footer>
</a-layout>
</template>
<script>
// 自动导入的组件无需手动导入
export default {}
</script>
接下来,我们将展示如何在项目中实际应用Ant Design Vue3.x的组件:
5. 高级特性:状态管理与表单验证
vue
<template>
<a-form :form="form">
<a-form-item label="Username">
<a-input v-model:value="form.username" />
</a-form-item>
<!-- 其他表单元素... -->
<a-form-item>
<a-button @click.prevent="submit">Submit</a-button>
</a-form-item>
</a-form>
</template>
<script>
import { reactive } from 'vue'
import { Form, FormItem, Input } from 'ant-design-vue'
export default {
setup() {
const form=reactive({
username: ''
// 其他表单字段...
})
const submit=()=> {
// 表单验证及提交逻辑...
}
return {
form,
submit,
Form,
FormItem,
Input
}
}
}
</script>
借助Vue3的Composition API和Ant Design Vue提供的Form组件,可以轻松实现复杂的状态管理和表单验证功能:
结语
通过本篇文章,我们详细介绍了如何在Vite环境下高效地运用Ant Design Vue3.x进行现代化UI开发实践,包括环境搭建、组件的按需加载、主题定制以及高级特性应用等关键环节。希望这能帮助您更好地利用这两个强大工具,提升开发效率的同时,打造出优雅且高效的用户界面。在未来的工作实践中,持续关注官方文档和社区动态,不断跟进前沿技术和最佳实践,将是保持竞争力的关键所在。
*请认真填写需求信息,我们会在24小时内与您取得联系。