Today, We want to share with you Nested Child Routes in Vuejs Navigate Menu.In this post we will show you Building a Page Layout for Vue Router, hear for Vue Router examples with Nav Bar, Dynamic Route & Nested Routes we will give you demo and example for implement.In this post, we will learn about Navigate Nested Child Routes In A Vue.js Web Application with an example.
Nested Child Routes in Vuejs Navigate Menu
There are the Following The simple About Nested Child Routes in Vuejs Navigate Menu Full Information With Example and source code.
As I will cover this Post with live Working example to develop vuejs Expose child routes on currentRoute object, so the vue router multiple nested routes for this example is following below.
vuejs Nested Child Routes
Make a simple a Fresh Vue.js Application with the Vue CLI
here show simple Navigate menu Nested Child Routes In A JavaScript create Vue.js Web Application
vue init webpack nested-application
cd nested-application npm install
Adding vuejs Components to Represent Parent and Child Routes using CLI should have a src/components/HelloWorld.vue file
src/components/article1.vue
<div class="article1"> <h1>{{ msg }}</h1> </div> export default { name: 'Article1', data () { return { msg: 'Welcome to Pakainfo.com for Your Vue.js App' } } } h1, h2 { font-weight: normal; } a { color: #c60000; }
src/App.vue
src/components/subcategory1.vue
<div class="subcategory1"> <p>{{ footnote }}</p> </div> export default { name: 'subcategory1', data () { return { footnote: 'Created by The Polyglot Developer' } } }
Designing the Vue.js Router
Simple HTML with CSS in Designing the Vue.js Router
src/router/index.js
import Vue from 'vue' import Router from 'vue-router' import Article1 from '@/components/article1' import subcategory1 from '@/components/subcategory1' Vue.use(Router) export default new Router({ routes: [ { path: "/", redirect: { name: "subcategory1" } }, { path: '/article1', name: 'Article1', component: Article1, children: [ { path: "subcategory1", name: "subcategory1", component: subcategory1 } ] } ] })
vuejs navigate to the child path
src/router/index.js
import Vue from 'vue' import Router from 'vue-router' import Article1 from '@/components/article1' import Page2 from '@/components/page2' import subcategory1 from '@/components/subcategory1' Vue.use(Router) export default new Router({ routes: [ { path: "/", redirect: { name: "subcategory1" } }, { path: '/article1', component: Article1, children: [ { path: "", name: "subcategory1", component: Subcategory1 } ] } ] })
Angular 6 CRUD Operations Application Tutorials
Read :
Summary
You can also read about AngularJS, ASP.NET, VueJs, PHP.
I hope you get an idea about Nested Child Routes in Vuejs Navigate Menu.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.