添加草稿功能
This commit is contained in:
@ -3,43 +3,56 @@
|
||||
.articleContent(ref='articleImgs', v-if='Articels')
|
||||
article.articleList(v-for='(post, index) in Articels', :key='index')
|
||||
.articleImgs(v-if='post.postImages.length')
|
||||
nuxt-link(:to="'/post/' + post.ID")
|
||||
Swiper(:style="'height: ' + imageHeight + 'px'")
|
||||
Slide(v-for="(imgUrl, inx) in post.postImages" :key="inx")
|
||||
nuxt-link(:to='"/post/" + post.ID')
|
||||
Swiper(:style='"height: " + imageHeight + "px"')
|
||||
Slide(v-for='(imgUrl, inx) in post.postImages', :key='inx')
|
||||
img(:src='imgUrl')
|
||||
.articleAbstract
|
||||
nuxt-link(:to="'/post/' + post.ID")
|
||||
nuxt-link(:to='"/post/" + post.ID')
|
||||
.articleTitle(v-html='post.post_title')
|
||||
.articalMeta
|
||||
ul
|
||||
li
|
||||
Icon(:icon="['far', 'calendar-alt']")
|
||||
Icon(:icon='["far", "calendar-alt"]')
|
||||
| {{ post.post_date }}
|
||||
li
|
||||
Icon(:icon="['far', 'bookmark']")
|
||||
nuxt-link(v-for='(relationships, idx) in post.term_relationships', :key='idx', v-if='relationships.term_taxonomy', :to="'/' + relationships.term_taxonomy.term.slug")
|
||||
Icon(:icon='["far", "bookmark"]')
|
||||
nuxt-link(
|
||||
v-for='(relationships, idx) in post.term_relationships',
|
||||
:key='idx',
|
||||
v-if='relationships.term_taxonomy',
|
||||
:to='"/" + relationships.term_taxonomy.term.slug'
|
||||
)
|
||||
span
|
||||
| {{ relationships.term_taxonomy.term.name }}
|
||||
li(v-if='post.postmetum.meta_value !== 0')
|
||||
Icon(:icon="['fas', 'thermometer-' + post.hotValue]")
|
||||
Icon(:icon='["fas", "thermometer-" + post.hotValue]')
|
||||
| {{ post.postmetum.meta_value }}
|
||||
.articelAbstractContent(v-html='post.post_excerpt || post.post_content')
|
||||
.articelAbstractContent(
|
||||
v-html='post.post_excerpt || post.post_content'
|
||||
)
|
||||
.readMore
|
||||
nuxt-link.readMoreBtn(:to="'/post/' + post.ID")
|
||||
nuxt-link.readMoreBtn(:to='"/post/" + post.ID')
|
||||
| READ MORE
|
||||
.Info(v-if='Info')
|
||||
| {{ Info }}
|
||||
nuxt-link(:to="nowPage > 2 ? nowPath + '/page/' + (nowPage - 1) : nowPath + '/'", :class="nowPage > 1 ? 'btn-footer btn-prev ' : 'btn-footer btn-prev btn-disable'")
|
||||
Icon(:icon="['fas', 'chevron-left']")
|
||||
nuxt-link(
|
||||
:to='nowPage > 2 ? nowPath + "/page/" + (nowPage - 1) : nowPath + "/"',
|
||||
:class='nowPage > 1 ? "btn-footer btn-prev " : "btn-footer btn-prev btn-disable"'
|
||||
)
|
||||
Icon(:icon='["fas", "chevron-left"]')
|
||||
| 上一页
|
||||
nuxt-link(:to="(nowPage + 1) <= Math.ceil(ArticelsCount / 8) ? nowPath + '/page/' + (nowPage + 1) : '#'", :class="(nowPage + 1) <= Math.ceil(ArticelsCount / 8) ? 'btn-footer btn-next' : 'btn-footer btn-next btn-disable'")
|
||||
nuxt-link(
|
||||
:to='nowPage + 1 <= Math.ceil(ArticelsCount / 8) ? nowPath + "/page/" + (nowPage + 1) : "#"',
|
||||
:class='nowPage + 1 <= Math.ceil(ArticelsCount / 8) ? "btn-footer btn-next" : "btn-footer btn-next btn-disable"'
|
||||
)
|
||||
| 下一页
|
||||
Icon(:icon="['fas', 'chevron-right']")
|
||||
Icon(:icon='["fas", "chevron-right"]')
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
async asyncData ({ app, params, query, $axios }) {
|
||||
async asyncData ({ app, params, query, $axios, redirect }) {
|
||||
let Info = null
|
||||
let Articels = []
|
||||
const nowPage = params.page ? parseInt(params.page) : 1
|
||||
@ -69,6 +82,8 @@ export default {
|
||||
}
|
||||
} else if (data.status === 404) {
|
||||
Info = '未找到文章。'
|
||||
// redirect('/404')
|
||||
// return
|
||||
}
|
||||
|
||||
return {
|
||||
|
Reference in New Issue
Block a user