Add route to Post view

master
Raymonzut 5 years ago
parent f89c9251e6
commit abcc91ca81
No known key found for this signature in database
GPG Key ID: 97CF2D8BE2C69FC7
  1. 7
      client/src/router/index.js
  2. 3
      client/src/views/Posts.vue

@ -2,6 +2,7 @@ import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Posts from '../views/Posts.vue'
import Post from '../views/Post.vue'
import QAPage from '../views/QAPage'
Vue.use(VueRouter)
@ -17,6 +18,12 @@ const routes = [
name: "Posts",
component: Posts,
},
{
path: "/posts/:id",
name: "Post",
component: Post,
props: true,
},
{
path: "/qa",
name: "QA",

@ -5,7 +5,8 @@
<div>
<ul>
<li v-for="(postItem, j) in getPostItems(month)" :key="j">
{{ getPostItemDate(postItem) }} {{ postItem.title }}
{{ getPostItemDate(postItem) }}
<a :href="/posts/ + postItem._id">{{ postItem.title }}</a>
</li>
</ul>
</div>

Loading…
Cancel
Save