发表于: 2020-02-25 22:44:35
1 1761
今天完成的事情:
1.推进任务
明天计划的事情:
1.推进任务
遇到的问题和收获:
watch: {
'$route'(to, from) {
this.$http({
method: 'get',
url: '/api/a/article/' + this.$route.query.id,
data: this.$qs.stringify(this.editInfo)
}).then(res => {
// console.log(res);
if (res.data.code === 0) {
console.log(res);
this.article.title = res.data.data.article.title
this.article.type = res.data.data.article.type
this.article.status = res.data.data.article.status
this.article.content = res.data.data.article.content
this.article.url = res.data.data.article.url
this.article.industry = res.data.data.article.industry
// this.$http.get('/api/a/article' + row.id, this.editInfo)
// this.$router.push({
// path: '/home/details'
// })
}
})
}
},
每次点编辑时进入编辑页面应该用什么来触发查询详情请求
用路由监视的话每次变化路由都会请求,会做出很多不必要的请求
评论