plan for ssg

This commit is contained in:
polv committed 2020-12-17 18:35:27 +07:00
1 parent a8867be72c
commit fb69b2710f
73 files changed
+921 -718

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
<template>
<post-query :posts="posts" :count="count" />
</template>
<script lang="ts">
import { Vue, Component } from 'nuxt-property-decorator'
@Component<BlogPagePaged>({
async asyncData({ $axios, params }) {
const { result, count } = await $axios.$get('/api/q', {
params: {
page: params.page,
},
})
return {
posts: result,
count,
}
},
})
export default class BlogPagePaged extends Vue {
posts: IPostTeaser[] = []
count = 0
}
</script>
+22
View File
@@ -0,0 +1,22 @@
<template>
<post-query :posts="posts" :count="count" />
</template>
<script lang="ts">
import { Vue, Component } from 'nuxt-property-decorator'
@Component<BlogPage>({
async asyncData({ $axios }) {
const { result, count } = await $axios.$get('/api/q')
return {
posts: result,
count,
}
},
})
export default class BlogPage extends Vue {
posts: IPostTeaser[] = []
count = 0
}
</script>