File tree Expand file tree Collapse file tree 4 files changed +41
-7
lines changed Expand file tree Collapse file tree 4 files changed +41
-7
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div id =" app" >
3
- <img alt =" Vue logo" src =" ./assets/logo.png" >
4
- <HelloWorld msg =" Welcome to Your Vue.js App" />
3
+ <!-- <img alt="Vue logo" src="./assets/logo.png" />
4
+ <HelloWorld msg="Welcome to Your Vue.js App" /> -->
5
+ <router-link to =" /foo" >Go to Foo</router-link >
6
+ <router-link to =" /bar" >Go to Bar</router-link >
7
+ <router-view ></router-view >
5
8
</div >
6
9
</template >
7
10
8
11
<script >
9
- import HelloWorld from ' ./components/HelloWorld.vue'
12
+ // import HelloWorld from " ./components/HelloWorld.vue";
10
13
11
14
export default {
12
- name: ' app' ,
15
+ name: " app" ,
13
16
components: {
14
- HelloWorld
17
+ // HelloWorld
15
18
}
16
- }
19
+ };
17
20
</script >
18
21
19
22
<style >
20
23
#app {
21
- font-family : ' Avenir' , Helvetica , Arial , sans-serif ;
24
+ font-family : " Avenir" , Helvetica , Arial , sans-serif ;
22
25
-webkit-font-smoothing : antialiased ;
23
26
-moz-osx-font-smoothing : grayscale ;
24
27
text-align : center ;
Original file line number Diff line number Diff line change 1
1
import Vue from 'vue'
2
2
import App from './App.vue'
3
+ import router from './router'
3
4
4
5
Vue . config . productionTip = false
5
6
6
7
new Vue ( {
8
+ router,
7
9
render : h => h ( App ) ,
8
10
} ) . $mount ( '#app' )
Original file line number Diff line number Diff line change
1
+ import VueRouter from 'vue-router'
2
+ import Vue from 'vue'
3
+
4
+ Vue . use ( VueRouter ) ;
5
+
6
+ const Foo = { template : '<div>foo</div>' }
7
+ const Bar = { template : '<div>bar</div>' }
8
+
9
+ // 2. Define some routes
10
+ // Each route should map to a component. The "component" can
11
+ // either be an actual component constructor created via
12
+ // `Vue.extend()`, or just a component options object.
13
+ // We'll talk about nested routes later.
14
+ const routes = [
15
+ { path : '/foo' , component : Foo } ,
16
+ { path : '/bar' , component : Bar }
17
+ ]
18
+
19
+ // 3. Create the router instance and pass the `routes` option
20
+ // You can pass in additional options here, but let's
21
+ // keep it simple for now.
22
+ const router = new VueRouter ( {
23
+ routes // short for `routes: routes`
24
+ } ) ;
25
+
26
+ export default router ;
Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ runtimeCompiler : true
3
+ }
You can’t perform that action at this time.
0 commit comments