Only show edit icon when admin is true.
This commit is contained in:
		| @@ -3,7 +3,7 @@ | |||||||
|     <header> |     <header> | ||||||
|       <div class="title"> |       <div class="title"> | ||||||
|         <h2>{{ post.title }}</h2> |         <h2>{{ post.title }}</h2> | ||||||
|         <router-link :to="'/edit/' + id" class="icon">✏️ </router-link> |         <router-link v-if="admin" :to="'/edit/' + id" class="icon">✏️ </router-link> | ||||||
|       </div> |       </div> | ||||||
|  |  | ||||||
|       <p>created {{ humanReadableDate(post.created) }},</p> |       <p>created {{ humanReadableDate(post.created) }},</p> | ||||||
| @@ -26,6 +26,7 @@ import { humanReadableDate } from "@/utils"; | |||||||
| export default { | export default { | ||||||
|   data() { |   data() { | ||||||
|     return { |     return { | ||||||
|  |       admin: false, | ||||||
|       markdown: undefined, |       markdown: undefined, | ||||||
|       id: this.$route.params.id, |       id: this.$route.params.id, | ||||||
|       post: undefined, |       post: undefined, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user