plan for ssg
This commit is contained in:
1 parent
a8867be72c
commit
fb69b2710f
73 files changed
+921
-718
No files matched your search
@@ -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>
|
||||
@@ -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>
|
||||
Reference in new issue
Block a user