其他分享
首页 > 其他分享> > jeecg 菜单路径显示问题

jeecg 菜单路径显示问题

作者:互联网

1、jeecg菜单路径未带上 publicPath: ‘/archive/’
修改env.production

BASE_URL=archive

修改@route/index.js

export default new Router({
  //mode: 'history',
  mode: 'history',
  **base:  process.env.BASE_URL,**
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap
})

修改@components/menu/index.js

renderMenuItem (menu) {
      const target = menu.meta.target || null
      const tag = target && 'a' || 'router-link'
      let props = { to: { name: menu.name } }
      if(menu.route && menu.route === '0'){
        props = { to: { path: this.$route.base+ menu.path } }
      }

      const attrs = { href: this.$route.base +menu.path, target: menu.meta.target }
 ...

标签:菜单,const,target,menu,route,路径,base,path,jeecg
来源: https://blog.csdn.net/tonysh_zds/article/details/122395211