Permalink
Browse files

vue-router

vue-router'ı projeye dahil ettik ve statik, dinamik url yapıları ile birlikte kullandık.
  • Loading branch information...
erselgulyaz committed Apr 23, 2018
1 parent bdef553 commit 3d6f3b6ee6b4abbe52e010c9ea60230834a62f56
Showing with 65 additions and 2 deletions.
  1. +5 −0 package-lock.json
  2. +2 −1 package.json
  3. +1 −1 src/App.vue
  4. +13 −0 src/components/Contact.vue
  5. +13 −0 src/components/Home.vue
  6. +15 −0 src/components/PostDetail.vue
  7. +16 −0 src/main.js
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -14,7 +14,8 @@
"build": "node build/build.js"
},
"dependencies": {
"vue": "^2.5.2"
"vue": "^2.5.2",
"vue-router": "^3.0.1"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
View
@@ -1,6 +1,6 @@
<template>
<div id="app">
{{message}}
<router-view />
</div>
</template>
View
@@ -0,0 +1,13 @@
<template>
<div>
Contact Page
</div>
</template>
<script>
export default {
}
</script>
<style scoped>
</style>
View
@@ -0,0 +1,13 @@
<template>
<div>
Home Page
</div>
</template>
<script>
export default {
}
</script>
<style scoped>
</style>
@@ -0,0 +1,15 @@
<template>
<div>
Post Detail Page
<hr>
ID => {{$route.params.id}}
</div>
</template>
<script>
export default {
}
</script>
<style scoped>
</style>
View
@@ -1,13 +1,29 @@
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import VueRouter from 'vue-router'
import App from './App'
import Home from './components/Home.vue'
import Contact from './components/Contact.vue'
import PostDetail from './components/PostDetail.vue'
Vue.use(VueRouter)
Vue.config.productionTip = false
const router = new VueRouter({
mode: 'history',
routes: [
{path: '/', component: Home},
{path: '/iletisim', component: Contact},
{path: '/yazi-detay/:id', component: PostDetail}
]
})
/* eslint-disable no-new */
new Vue({
el: '#app',
components: { App },
router: router,
template: '<App/>'
})

0 comments on commit 3d6f3b6

Please sign in to comment.