27 lines
511 B
Vue
27 lines
511 B
Vue
<template>
|
|
<post-query :posts="posts" :count="count" />
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { Vue, Component } from 'nuxt-property-decorator'
|
|
|
|
@Component<BlogPage>({
|
|
async asyncData({ $axios }) {
|
|
if (process.static && typeof location !== 'undefined') {
|
|
location.reload()
|
|
}
|
|
|
|
const { result, count } = await $axios.$get('/api/q')
|
|
|
|
return {
|
|
posts: result,
|
|
count,
|
|
}
|
|
},
|
|
})
|
|
export default class BlogPage extends Vue {
|
|
posts: IPostTeaser[] = []
|
|
count = 0
|
|
}
|
|
</script>
|