index.js 980 B

1234567891011121314151617181920212223242526
  1. import { createRouter, createWebHistory } from 'vue-router'
  2. import { staticRoutes } from './constantRoutes'
  3. //缺陷:由于接口设计缺陷 menulist 返回不是一个类似的 路由信息 需要子级构造 多参数前端写死 @/stroe/permission
  4. // hidden: true,// 侧边栏隐藏
  5. // alwaysShow: false,//是否总是显示 (多用于控制目录只有一个菜单是否显示菜单) 目录属性
  6. // redirect: true,//在面包屑中是否可以点击
  7. // meta: {
  8. // title: 'title',
  9. // icon: 'Box',
  10. // cache:false, //是否缓存keepalive
  11. // affix: true, //是否增加固定
  12. // breadcrumb: false //是否添加到面包屑
  13. // link:是否是链接 由于新建标签 显示故 暂时无作用
  14. // micro:true //底座必须加
  15. // },
  16. const router = createRouter({
  17. history: createWebHistory(),
  18. routes: staticRoutes,
  19. // 刷新时,滚动条位置还原
  20. scrollBehavior: () => ({ left: 0, top: 0 })
  21. })
  22. export default router