Created
November 2, 2015 20:39
-
-
Save yyx990803/dd7dca7d232945908642 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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