一套基于 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小時內與您取得聯系。