Vuejs Implementing Routes And Multiple Views Example

In this Post We Will Explain About is Vuejs Implementing Routes And Multiple Views 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 Vuejs multiple views on one pageExample

In this post we will show you Best way to implement multiple ng-view in single template (Vuejs), hear for Vuejs multiple views on one pagewith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Include Scripts

<a href="https://unpkg.com/vue/dist/vue.js">https://unpkg.com/vue/dist/vue.js</a>
<a href="https://unpkg.com/vue-router/dist/vue-router.js">https://unpkg.com/vue-router/dist/vue-router.js</a>

index.html File

<div id="app">
  <h1>Hello App!</h1>
  <p>
    <!-- use simple nav menu v-link directive using vuejs for navigation. -->
    <a>Go to home</a>
    <a>Go to about</a>
  </p>
  <!-- use simple libs to router-view HTML element as route all the DOM outlet -->
  
</div>

index.js file

var home = Vue.extend({
    template: '<p>This is home!</p>'
})

var about = Vue.extend({
    template: '<p>This is about!</p>'
})

var App = Vue.extend({})

var router = new VueRouter()

router.map({
    '/home': {
        component: home
    },
    '/about': {
        component: about
    }
})

router.start(App, '#app')

CSS File

.v-link-active {
    color: green;
}

Example

READ :  16 Great Commonly used PHP String Functions

I hope you have Got What is ui router nested named views using Vuejs 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.