remove pug
This commit is contained in:
1 parent
e397c9ae1e
commit
68840c9c60
49 files changed
+1421
-806
No files matched your search
@@ -0,0 +1,28 @@
|
||||
<template>
|
||||
<p v-if="$fetchState.pending"></p>
|
||||
<p v-else-if="$fetchState.error">An error occurred {{ $fetchState.error }}</p>
|
||||
<post-query v-else :posts="posts" :count="count" />
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Vue, Component } from 'nuxt-property-decorator'
|
||||
|
||||
@Component<TagPage>({
|
||||
async fetch() {
|
||||
const { result, count } = await this.$axios.$get('/q', {
|
||||
params: {
|
||||
q: this.$route.query.q,
|
||||
page: this.$route.query.page,
|
||||
tag: this.$route.params.tag,
|
||||
},
|
||||
})
|
||||
|
||||
this.posts = result
|
||||
this.count = count
|
||||
},
|
||||
})
|
||||
export default class TagPage extends Vue {
|
||||
posts: IPostTeaser[] = []
|
||||
count = 0
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,30 @@
|
||||
<template>
|
||||
<p v-if="$fetchState.pending"></p>
|
||||
<p v-else-if="$fetchState.error">
|
||||
An error occurred {{ $fetchState.error.message }}
|
||||
</p>
|
||||
<p v-else-if="!posts.length">No posts found.</p>
|
||||
<post-query v-else :posts="posts" :count="count" />
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Vue, Component } from 'nuxt-property-decorator'
|
||||
|
||||
@Component<BlogPage>({
|
||||
async fetch() {
|
||||
const { result, count } = await this.$axios.$get('/api/q', {
|
||||
params: {
|
||||
q: this.$route.query.q,
|
||||
page: this.$route.query.page,
|
||||
},
|
||||
})
|
||||
|
||||
this.posts = result
|
||||
this.count = count
|
||||
},
|
||||
})
|
||||
export default class BlogPage extends Vue {
|
||||
posts: IPostTeaser[] = []
|
||||
count = 0
|
||||
}
|
||||
</script>
|
||||
@@ -1,30 +1,9 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div>
|
||||
<div class="links">
|
||||
<a
|
||||
href="https://nuxtjs.org/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="button--green"
|
||||
>
|
||||
Documentation
|
||||
</a>
|
||||
<a
|
||||
href="https://github.com/nuxt/nuxt.js"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="button--grey"
|
||||
>
|
||||
GitHub
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue'
|
||||
|
||||
export default Vue.extend({})
|
||||
export default Vue.extend({
|
||||
middleware: (ctx) => {
|
||||
ctx.redirect('/blog')
|
||||
},
|
||||
})
|
||||
</script>
|
||||
Reference in new issue
Block a user