computed: {
Category () {
return this.$store.state.categories.Categories.find(item => item.Alias === this.$route.params.category)
}
},
asyncData ({ params, error }) {
return axios.get(`https://my-api/posts/${params.id}`)
.then((res) => {
return { title: res.data.title }
})
.catch((e) => {
error({ statusCode: 404, message: 'Post not found' })
})
}
// Еще вариант
this.$nuxt.error({ statusCode: 404, message: err.message })