vue轻量级后台管理系统基础模板
在线预览vue
2019.3.14 更新
增长404页面 假如跳转到一个不存在的页面时会重定向到404页面ios
2019.3.8 更新
增长面包屑功能,用于展现当前页面的路径
增长权限控制功能,若是未登录,访问全部页面都重定向到登录页git
2019.3.1 更新
增长动态菜单栏功能
icon
使用的是iview
组件的icon
组件。
数据格式:github
// 左侧菜单栏数据
menuItems: [
{
name: 'Home', // 要跳转的路由名称 不是路径
size: 18, // icon大小 非必填
type: 'md-home', // icon类型 非必填
text: '主页' // 文本内容
},
{
text: '二级菜单',
type: 'ios-paper',
children: [
{
type: 'ios-grid',
name: 'T1',
text: '表格'
},
{
text: '三级菜单',
type: 'ios-paper',
children: [
{
type: 'ios-notifications-outline',
name: 'Msg',
text: '查看消息'
},
{
type: 'md-lock',
name: 'Password',
text: '修改密码'
},
{
type: 'md-person',
name: 'UserInfo',
text: '基本资料',
}
]
}
]
}
]
复制代码
注意: 组件的名称和路由的名称必定要一致,例如 Home.vue
组件名称 name: home
,则在路由文件中也要给它设置为 name: home
,不然页面内容不能缓存ajax
// 在router文件中
{
path: 'home',
name: 'home',
component: () => import('../views/Home.vue')
}
// 在Home.vue中
export default {
name: 'home'
}
复制代码
axios
拦截器 实现了ajax
请求前展现loading
请求结束关闭loading
Index
组件通常状况下只须要传数据就行 其余不用关注vue-router
市面上有大量的vue后台管理系统模板 可是功能都太丰富了 并且有不少组件用不上 因此写了这么一个最基础的 只有必要功能的模板 UI库使用的是iView
有大量的组件可用vuex
// xxx为你想跳转的子组件name
this.$parent.gotoPage('xxx')
复制代码
this.gotoPage('userinfo', {
id: id,
})
// 在userinfo组件里取参
this.$route.params.id
复制代码
git clone git@github.com:woai3c/vue-admin-template.git
cd vue-admin-template
npm i
复制代码
npm run serve
复制代码
npm run build
复制代码