website now works
This commit is contained in:
1 parent
ce56fcb91c
commit
3daa9f82e7
15 files changed
+241
-137
No files matched your search
@@ -9,16 +9,26 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { Vue, Component } from 'nuxt-property-decorator'
|
||||
import { api } from '~/assets/global'
|
||||
|
||||
@Component<BlogPage>({
|
||||
watch: {
|
||||
'$route.query.q': '$fetch',
|
||||
'$route.query.page': '$fetch',
|
||||
},
|
||||
async fetch() {
|
||||
const { result, count } = await this.$axios.$get('/api/q', {
|
||||
const { result, count, error } = await api('/api/q', {
|
||||
params: {
|
||||
q: this.$route.query.q,
|
||||
page: this.$route.query.page,
|
||||
},
|
||||
})
|
||||
|
||||
if (error) {
|
||||
this.$nuxt.error(error)
|
||||
return
|
||||
}
|
||||
|
||||
this.posts = result
|
||||
this.count = count
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user