perf[Exapme]: set page title according to article id
This commit is contained in:
parent
71ece14be1
commit
4f9efc8ea4
|
@ -185,12 +185,16 @@ export default {
|
||||||
fetchData(id) {
|
fetchData(id) {
|
||||||
fetchArticle(id).then(response => {
|
fetchArticle(id).then(response => {
|
||||||
this.postForm = response.data
|
this.postForm = response.data
|
||||||
// Just for test
|
|
||||||
|
// just for test
|
||||||
this.postForm.title += ` Article Id:${this.postForm.id}`
|
this.postForm.title += ` Article Id:${this.postForm.id}`
|
||||||
this.postForm.content_short += ` Article Id:${this.postForm.id}`
|
this.postForm.content_short += ` Article Id:${this.postForm.id}`
|
||||||
|
|
||||||
// Set tagsview title
|
// set tagsview title
|
||||||
this.setTagsViewTitle()
|
this.setTagsViewTitle()
|
||||||
|
|
||||||
|
// set page title
|
||||||
|
this.setPageTitle()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
})
|
})
|
||||||
|
@ -200,6 +204,10 @@ export default {
|
||||||
const route = Object.assign({}, this.tempRoute, { title: `${title}-${this.postForm.id}` })
|
const route = Object.assign({}, this.tempRoute, { title: `${title}-${this.postForm.id}` })
|
||||||
this.$store.dispatch('tagsView/updateVisitedView', route)
|
this.$store.dispatch('tagsView/updateVisitedView', route)
|
||||||
},
|
},
|
||||||
|
setPageTitle() {
|
||||||
|
const title = 'Edit Article'
|
||||||
|
document.title = `${title} - ${this.postForm.id}`
|
||||||
|
},
|
||||||
submitForm() {
|
submitForm() {
|
||||||
console.log(this.postForm)
|
console.log(this.postForm)
|
||||||
this.$refs.postForm.validate(valid => {
|
this.$refs.postForm.validate(valid => {
|
||||||
|
|
Loading…
Reference in New Issue