Skip to content

Instantly share code, notes, and snippets.

@yyx990803
Created November 2, 2015 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yyx990803/dd7dca7d232945908642 to your computer and use it in GitHub Desktop.
Save yyx990803/dd7dca7d232945908642 to your computer and use it in GitHub Desktop.
import Vue from 'vue'
import VueRouter from 'vue-router'
import App from './app.vue'
import ViewA from './view-a.vue'
import ViewB from './view-b.vue'
Vue.use(VueRouter)
const router = new VueRouter()
router.map({
'/a': { component: ViewA },
'/b': { component: ViewB }
})
router.start(App, '#app')
<template>
<div>
<h1>This is the layout that won't change</h1>
<router-view><!-- matched component renders here --></router-view>
</div>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment