Adding initial nuxt version for static page.
This commit is contained in:
parent
0f7094c61a
commit
1671d19134
28 changed files with 2744 additions and 102 deletions
27
2022/01/nuxt_demo1/components/Post.vue
Normal file
27
2022/01/nuxt_demo1/components/Post.vue
Normal file
|
@ -0,0 +1,27 @@
|
|||
<template>
|
||||
<div>
|
||||
<div v-html="renderedTemplate"></div>
|
||||
<NuxtLink :to="'/blog/post/' + this.template.info.slug">Read me</NuxtLink>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import MarkdownIt from 'markdown-it';
|
||||
import MarkdownItAttrs from 'markdown-it-attrs';
|
||||
|
||||
const md = new MarkdownIt();
|
||||
md.use(MarkdownItAttrs, {});
|
||||
|
||||
export default {
|
||||
name: 'Post',
|
||||
computed: {
|
||||
renderedTemplate: function() {
|
||||
return md.render(this.template.data);
|
||||
}
|
||||
},
|
||||
props: ['template'],
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@import "~assets/main.scss";
|
||||
</style>
|
Loading…
Add table
Add a link
Reference in a new issue