vue cli3 的子路由


vue cli3 的子路由 無非就是在父級路由下創建一個子級路由children來包括起來

const routes = [
    {path:"/", component:ResourceHome},
    {path:"/new", component:ResourceNew,
  children:[
    {path:"",component:ResourceName},
    {path:"other"component:RespourceOther}
  ]
 },
]
    //創建路由
    const router = createRouter({
        history:createWebHistory(),
        //第一個router是參數,第二個routes是配置路由中的routes,可以只寫一個routes
        routes
    });

其他的方式引入是不變的,該引入的還是需要進行一次引入


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM