我瞅了下官网 没做说明啊,有大神知道的吗,非常感谢。
- 发布:2021-03-29 08:51
- 更新:2021-11-09 11:37
- 阅读:3077
7***@qq.com - life is a fucking movie
onShareTimeline() {
return {
title: '自定义标题',
query: {//页面携带参数
key: value
},
imageUrl: '自定义图片路径'
};
}
h***@163.com (作者)
onLoad(options) {
console.log('options',options)
if(options.id){
console.log(options)
this.id=options.id;
}else{
let query=this.$Route.query
console.log(query)
this.id=query;
}
this.getDetail()
}
初始化时获取不到id信息
options undefined
growthPreview.js? [sm]:25 params undefined
VM207 WAService.js:2 TypeError: Cannot read property 'id' of undefined
at i.onLoad (growthPreview.js? [sm]:25)
at i.u (vendor.js? [sm]:197)
at vendor.js? [sm]:193
at w (vendor.js? [sm]:43)
at Generator._invoke (vendor.js? [sm]:43)
at Generator.e.<computed> [as next] (vendor.js? [sm]:43)
at l (vendor.js? [sm]:193)
at i (vendor.js? [sm]:193)
h***@163.com (作者)
谢谢回答 但是貌似还是不行呢
onShareTimeline() {
return {
title: "" + this.myFormData.userId + "学编程【" + this.typeName + "】报告已生成,快来看看吧~",
// path: '/pages/growth/growthPreview?id='+this.myFormData.id,
// query:'/pages/growth/growthPreview?id='+this.myFormData.id,
query: {//页面携带参数
id: this.myFormData.id
},
imageUrl: this.imgUrl,
content: '学编程,就来【高新编程猫】,赢在未来',
desc: "" + this.myFormData.userId + "学编程又有新作品啦,快来看看吧~",
success: res => {
console.info('分享成功了',res)
}
}
}
2021-03-29 10:07