Vue-router – Routing using Vuejs – Dynamic Components in Vuejs

Vue-router – Routing using Vuejs – Dynamic Components in Vuejs

Vue-router – Routing using Vuejs – Dynamic Components in Vuejs

In this Post We Will Explain About is Vue-router – Routing using Vuejs – Dynamic Components in Vuejs With Example and Demo.

Welcome on infinityknow.com – Examples ,The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to outing using Vuejs – Dynamic Components in Vuejs

how is the template rendered

We will start off by simple router exploring which router the interface is simple rendered. whatever the simple window.location.hash all the changes, the create a simple ViewComponent() changes. The Methods returns an object all the representation of a simple Vue Component.

READ :  Vue.js Routing With vue-router

routes: [
  {path: '/', component: PeopleListing},
  {name: 'person', path: '/:id', component: PersonDetail}
]

Create an App in VueJS 2

E-junkie: Sell digital downloads online

E-junkie Provides a Copy-paste buy-now, and cart buttons for selling downloads, codes and tangible products on any website, blog, social media, email and messenger!

Also see:

  1. The Top 10+ Best Webinar Software Platforms For 2020-2021
  2. Build Your Future Godaddy Careers And Jobs
  3. Introduction To Web Hosting Services

VueJS is simple coming out with a latest version. Learn step by steps changed by building a simple application.

Step 1 : mkdir vuejs2-authentication
Step 2 : cd vuejs2-authentication
Step 3 : npm init -y
Step 4 : npm install simple --save-dev nodemon
Step 5 : npm install

Vue-router Example – Dynamic Components in Vue.js

const NotFound = { template: '<p>Simple Page not found</p>' }
const products = { template: '<p>products page</p>' }
const services = { template: '<p>services page</p>' }
const routes = {
  '/': products,
  '/services': services
}
new Vue({
  el: '#liveapp',
  data: {
    activeroute: window.location.pathname
  },
  computed: {
    ViewComponent () {
      return routes[this.activeroute] || NotFound
    }
  },
  render (h) { return h(this.ViewComponent) }
})

Example

I hope you have Got VueJS Routing Example – Dynamic Components in Vue.js And how it works.I would Like to have FeadBack From My Blog(infinityknow.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(infinityknow.com) Are Most Always Welcome.

READ :  Include common header and footer using Vuejs - router-view