Astralis
V2EX  ›  Vue.js

请教一下这种情况该怎么写路由

  •  
  •   Astralis · Jun 11, 2018 · 2596 views
    This topic created in 3069 days ago, the information mentioned may be changed or developed.
    导航下面包含有二级导航

    首页 localhost:8080/#/
    课程 localhost:8080/#/course
    直播 localhost:8080/#/live
    资讯 localhost:8080/#/news

    然后法规和报告是二级导航的,在 news 下面,但是 news 这个路由是没有东西的,页面里只有一个 router-view,所以打开 localhost:8080/#/news 会出现一个空白的页面,这种情况怎么处理比较好?

    法规 localhost:8080/#/news/laws
    报告 localhost:8080/#/news/report
    3 replies  •  2018-06-18 11:55:01 +08:00
    rrfeng
    rrfeng
    Jun 11, 2018 via Android❤️1
    1
    让 news 默认跳到 news/laws
    Astralis
    Astralis
    OP
    Jun 11, 2018
    2
    @rrfeng #1 感谢,暂时就先这么弄了
    TingLen
    TingLen
    Jun 18, 2018
    3
    redirect:news/laws
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5636 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 02:26 · PVG 10:26 · LAX 18:26 · JFK 21:26
    ♥ Do have faith in what you're doing.