0👍
Use head(){}
instead of head: {}
The head
property could be Object
and Function
, you can have dynamic meta/title tags via Function
data() {
return {
blog: {}
}
},
async fetch() {
let { data } = await axios.get(`/blogs/${this.$route.params.id}`);
this.blog = data;
},
head() {
return {
title: this.blog?.title
}
}
// or using asyncData
async asyncData({ route }) {
let { data } = await axios.get(`/blogs/${route.params.id}`);
return {
blog: data
}
},
head() {
return {
title: this.blog.title
}
}
- [Vuejs]-VS Code emmet custom snippets in .vue file
- [Vuejs]-I should not get the table column if I didn't give input field
Source:stackexchange.com