This commit is contained in:
2022-02-07 22:27:54 +08:00
parent 31fdf5cc28
commit f1e778d198
5 changed files with 52 additions and 2 deletions

View File

@@ -8,7 +8,7 @@
.title {{ item.user.name }}
.info
span {{ rwdate(item.updatedAt) }}
p {{ item.data }}
div(v-html="markdown(item.data)")
.post-none(v-else) 没有评论~
</template>
@@ -48,6 +48,7 @@
</style>
<script>
import { marked } from "marked";
export default {
props: ["data"],
methods: {
@@ -55,6 +56,9 @@ export default {
let t = new Date(utc);
return t.getMonth() + 1 + "月 " + t.getDate() + ", " + t.getFullYear();
},
markdown(data) {
return marked.parse(data);
},
},
};
</script>