赞
踩
引用:https://www.cnblogs.com/panwudi/p/17074172.html
uniapp开发的微信小程序,没有转发,分享:
创建一个mixin:common/share.js
export default {
onShareAppMessage(res) { //发送给朋友
return {}
},
onShareTimeline(res) {//分享到朋友圈
return {}
},
}
全局使用,在 main.js 里面 添加全局的 mixin
import share from './common/share.js'
Vue.mixin(share)
const app = new Vue({
...App,share
})
自定义分享内容
export default { data() { return { share:{ title: '自定义分享标题', imageUrl:'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg', } } }, onShareAppMessage(res) { //发送给朋友 return { title: this.share.title, imageUrl: this.share.imageUrl, } }, onShareTimeline(res) {//分享到朋友圈 return { title: this.share.title, imageUrl: this.share.imageUrl, } }, }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。