Git Product home page Git Product logo

Comments (9)

pany-ang avatar pany-ang commented on July 21, 2024

SXHJPL J)CR WDA8 YLPXV2
923)V B{{GFW4AG4MCOF8

from v3-admin.

pany-ang avatar pany-ang commented on July 21, 2024

默认情况下,如果 children 下只有一个子路由,那么就不会显示父路由。如果这种情况下要显示父路由,那么要在父路由设置 alwaysShow: true

from v3-admin.

lolicrafter avatar lolicrafter commented on July 21, 2024

大佬好,我是想把 '/'根路径的父路由隐藏,只显示里面的子路由(数量大于1).
就如图上的,不显示'测试',只显示首页等等...如图,想要这样的效果.⬇
路由


目前只能每次都要把单独一个路由放到Layout的children里面才能实现这样的效果.

from v3-admin.

pany-ang avatar pany-ang commented on July 21, 2024

那是肯定。但是你为什么要把这些看着像同级的路由,放到根路由的 children 里呢,感觉不必这么做

from v3-admin.

lolicrafter avatar lolicrafter commented on July 21, 2024

因为我想要打开新标签的时候左侧菜单栏一直存在,
不然的话打开一个路由就变成这样了
路由2
路由3

from v3-admin.

pany-ang avatar pany-ang commented on July 21, 2024

你并没有找到正确是使用方法...

你像这样新增路由,不就可以解决你的问题了吗?

{
    path: '/tag',
    component: Layout,
    redirect: '/tag/index',
    children: [
      {
        path: 'index',
        component: () => import(/* webpackChunkName: "tag" */ '@/views/tag/index.vue'),
        name: 'Tag',
        meta: {
          title: 'tag',
          icon: 'tag'
        }
      }
    ]
  },

from v3-admin.

pany-ang avatar pany-ang commented on July 21, 2024

并不是像你这样全部都添加到根路由的 children。children 明显是子路由的意思,不是用来存放同级路由的

from v3-admin.

lolicrafter avatar lolicrafter commented on July 21, 2024

你并没有找到正确是使用方法...

你像这样新增路由,不就可以解决你的问题了吗?

{
    path: '/tag',
    component: Layout,
    redirect: '/tag/index',
    children: [
      {
        path: 'index',
        component: () => import(/* webpackChunkName: "tag" */ '@/views/tag/index.vue'),
        name: 'Tag',
        meta: {
          title: 'tag',
          icon: 'tag'
        }
      }
    ]
  },

但是这样每次都要新增路由,然后再添加到children里面.
我想直接放到根路由里省事了.

from v3-admin.

pany-ang avatar pany-ang commented on July 21, 2024

好吧,那就只能根据自己需求去修改源码逻辑了

from v3-admin.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.