[+] Display blog post info
This commit is contained in:
@@ -1,6 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="BlogPostPreview">
|
<div id="BlogPostPreview" class="card">
|
||||||
<div id="title">{{meta.title}}</div>
|
<div id="date">{{meta.date}}</div>
|
||||||
|
<div id="titles">
|
||||||
|
<div id="title">{{meta.title}}</div>
|
||||||
|
<div id="subtitle" v-if="meta.subtitle">{{meta.subtitle}}</div>
|
||||||
|
</div>
|
||||||
|
<div id="expand">展开...</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -30,10 +35,10 @@ export default class BlogPostPreview extends Vue
|
|||||||
{
|
{
|
||||||
if (!this.meta.subtitle)
|
if (!this.meta.subtitle)
|
||||||
{
|
{
|
||||||
fetch(`${hosts.content}/${this.meta.file}`).then(it => it.text()).then(it =>
|
// fetch(`${hosts.content}/${this.meta.file}`).then(it => it.text()).then(it =>
|
||||||
{
|
// {
|
||||||
this.meta.subtitle = marked(it)
|
// this.meta.subtitle = marked(it)
|
||||||
})
|
// })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,8 +59,7 @@ export default class PostView extends Vue
|
|||||||
display: none
|
display: none
|
||||||
|
|
||||||
.post
|
.post
|
||||||
width: 100%
|
padding: 12px 20px 8px
|
||||||
|
|
||||||
text-align: left
|
text-align: left
|
||||||
|
|
||||||
> *
|
> *
|
||||||
|
|||||||
+2
-1
@@ -156,10 +156,11 @@ html
|
|||||||
|
|
||||||
|
|
||||||
.card
|
.card
|
||||||
|
width: 100%
|
||||||
background: #fdf9f1
|
background: #fdf9f1
|
||||||
border-radius: 20px
|
border-radius: 20px
|
||||||
margin-bottom: 20px
|
margin-bottom: 20px
|
||||||
padding: 12px 20px 8px
|
padding: 15px 20px
|
||||||
overflow: auto
|
overflow: auto
|
||||||
overflow-x: hidden
|
overflow-x: hidden
|
||||||
box-sizing: border-box
|
box-sizing: border-box
|
||||||
|
|||||||
+3
-1
@@ -24,5 +24,7 @@ export default class Blog extends Vue
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="sass" scoped>
|
<style lang="sass" scoped>
|
||||||
|
#Blog
|
||||||
|
width: 600px
|
||||||
|
margin: 20px auto
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user