Skip to content
This repository was archived by the owner on May 7, 2021. It is now read-only.

Commit 4052bbe

Browse files
committed
要りそうなものをとりあえず入れた
1 parent 894bf9c commit 4052bbe

File tree

8 files changed

+87
-21
lines changed

8 files changed

+87
-21
lines changed

package-lock.json

Lines changed: 12 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"lint": "vue-cli-service lint"
99
},
1010
"dependencies": {
11-
"vue": "^2.5.21"
11+
"vue": "^2.5.21",
12+
"vue-router": "^3.0.1",
13+
"vuex": "^3.0.1"
1214
},
1315
"devDependencies": {
1416
"@vue/cli-plugin-babel": "^3.3.0",

src/App.vue

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
<template>
22
<div id="app">
3-
<img alt="Vue logo" src="./assets/logo.png">
4-
<HelloWorld msg="Welcome to Your Vue.js App"/>
3+
<div id="nav">
4+
<router-link to="/">Home</router-link> |
5+
<router-link to="/about">About</router-link>
6+
</div>
7+
<router-view/>
58
</div>
69
</template>
710

8-
<script>
9-
import HelloWorld from './components/HelloWorld.vue'
10-
11-
export default {
12-
name: 'app',
13-
components: {
14-
HelloWorld
15-
}
16-
}
17-
</script>
18-
1911
<style>
2012
#app {
2113
font-family: 'Avenir', Helvetica, Arial, sans-serif;

src/main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import Vue from 'vue'
22
import App from './App.vue'
3+
import router from './router'
4+
import store from './store'
35

46
Vue.config.productionTip = false
57

68
new Vue({
7-
render: h => h(App),
9+
router,
10+
store,
11+
render: h => h(App)
812
}).$mount('#app')

src/router.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import Vue from 'vue'
2+
import Router from 'vue-router'
3+
import Home from './views/Home.vue'
4+
5+
Vue.use(Router)
6+
7+
export default new Router({
8+
routes: [
9+
{
10+
path: '/',
11+
name: 'home',
12+
component: Home
13+
},
14+
{
15+
path: '/about',
16+
name: 'about',
17+
// route level code-splitting
18+
// this generates a separate chunk (about.[hash].js) for this route
19+
// which is lazy-loaded when the route is visited.
20+
component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
21+
}
22+
]
23+
})

src/store.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Vue from 'vue'
2+
import Vuex from 'vuex'
3+
4+
Vue.use(Vuex)
5+
6+
export default new Vuex.Store({
7+
state: {
8+
9+
},
10+
mutations: {
11+
12+
},
13+
actions: {
14+
15+
}
16+
})

src/views/About.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div class="about">
3+
<h1>This is an about page</h1>
4+
</div>
5+
</template>

src/views/Home.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<template>
2+
<div class="home">
3+
<img alt="Vue logo" src="../assets/logo.png">
4+
<HelloWorld msg="Welcome to Your Vue.js App"/>
5+
</div>
6+
</template>
7+
8+
<script>
9+
// @ is an alias to /src
10+
import HelloWorld from '@/components/HelloWorld.vue'
11+
12+
export default {
13+
name: 'home',
14+
components: {
15+
HelloWorld
16+
}
17+
}
18+
</script>

0 commit comments

Comments
 (0)