基于iView-admin的后台管理脚手架项目,用于快速构建项目
npm install
npm run dev
npm run build
.
├── build 项目构建配置
├── config 开发相关配置
├── public 打包所需静态资源
└── src
├── api AJAX请求
└── assets 项目静态资源
├── icons 自定义图标资源
└── images 图片资源
├── components 业务组件
├── config 项目运行配置
├── directive 自定义指令
├── libs 封装工具函数
├── locale 多语言文件
├── mock mock模拟数据
├── router 路由配置
├── store Vuex配置
├── view 页面文件
└── tests 测试相关
以添加的账单管理
为例,在routers.js中添加如下代码
{
path: '/bill',
name: 'bill',
component: Main,
meta: {
hideInBread: true,
icon: 'ios-book',
},
children: [
{
path: 'detail',
name: 'detail',
meta: {
icon: 'md-trending-up',
title: '账单详情'
},
component: () => import('@/view/bill/index.vue')
}
]
},
添加菜单栏统一采用该方式,如果只有一栏(没有子菜单),children 中只需添加一个即可。component
需要选择Main,只有这样才能保证组件不整个页面显示