使用Vue3
,Vite
,TypeScript
,Ant Design Vue
等主流技术开发的开箱即用的中后台前端项目,支持keepalive
功能,Vite
自动生成路由,pinia
状态管理,vxe-table
虚拟滚动表格,UnoCss
开发样式。
演示地址
git clone https://github.com/southliu/vue-admin.git
- 参考 iconify官方地址
- VS Code安装Iconify IntelliSense - 图标内联显示和自动补全
Git提交不规范会导致无法提交,feat
关键字可以按照下面Git 贡献提交规范
来替换。
git add .
git commit -m "feat: 新增功能"
git push
npx husky add .husky/commit-msg 'npx --no-install commitlint --edit "$1"'
如果需要使用keep-alive功能则需要文件名里面添加name即可。
/**
* 需要通过路径转换成对应的name
* /system/user => SystemUser
* /content/article => ContentArticle
*/
defineOptions({
name: 'SystemUser'
});
- 功能扩展,在原有的api上拓展。
- 功能整合,合并两个或两个以上组件的api。
- 样式统一,避免后期样式变动,导致牵一发而动全身。
属性名 |
必填 |
属性说明 |
name |
是 |
表单域字段,如果是嵌套格式,则为数组 |
label |
是 |
表单标签 |
rules |
否 |
表单规则,参考模板 |
component |
是 |
组件名,参考Antv名称,如Input |
componentProps |
否 |
组件属性,参考对应文档API,方法都是on开头,如dropdownVisibleChange要改为onDropdownVisibleChange |
属性名 |
必填 |
属性说明 |
id |
否 |
唯一标识(被某些特定的功能所依赖) |
data |
是 |
表格数据 |
columns |
是 |
列数据 |
isLoading |
否 |
加载动画 |
offsetHeight |
否 |
高度偏移差,当表格高度过高出现滚动条的时候使用 |
isResize |
否 |
是否开启监听窗口变化而更改高度 |
分页器(BasicPagination):
属性名 |
必填 |
属性说明 |
total |
否 |
数据总数 |
page |
是 |
当前页数 |
pageSize |
是 |
每页条数 |
isLoading |
否 |
加载动画 |
API下拉框(ApiSelect、ApiTreeSelect):
属性名 |
必填 |
属性说明 |
value |
否 |
下拉框绑定值 |
componentProps |
否 |
下拉框值,ApiSelect属性,ApiTreeSelect属性 |
api |
是 |
API接口 |
params |
否 |
接口参数 |
onDropdownVisibleChange |
否 |
展开下拉菜单的回调 |
业务组件存放在src/components/Business
目录下,每次新增组件想要在src/components/Business/index.tsx文件中引入。