和生命周期是同级,在.js文件里面设置
// 分享按钮 onShareAppMessage: function () { return { title: ‘前端伪大叔‘, path: "/pages/list/list", imageUrl: "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2854956166,1658664264&fm=26&gp=0.jpg" } }
点击按钮分享
// 需要加上open-type属性; <button open-type="share">点击分享</button> onShareAppMessage: function () { return { title: ‘前端伪大叔‘, path: "/pages/list/list", imageUrl: "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2854956166,1658664264&fm=26&gp=0.jpg" } }
喜欢的小伙伴可以关注为的微信公众号“前端伪大叔”
原文地址:https://www.cnblogs.com/qdwds/p/11707065.html
时间: 2024-11-02 23:54:28