Only show edit icon when admin is true.

This commit is contained in:
2021-01-04 19:23:47 +01:00
parent 38bca9bab2
commit 2cb85aac76

View File

@@ -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,