html:
<div class="bdsharebuttonbox bdshare-button-style1-24">
<a href="#" class="bds_weixin" data-cmd="weixin" :data-id="item.id" @click="abc(item.id,item.major)" title="分享到微信"></a>
<a href="#" class="bds_tsina" data-cmd="tsina" :data-id="item.id" @click="abc(item.id,item.major)" title="分享到新浪微博" ></a>
<a href="#" class="bds_sqq" data-cmd="sqq" :data-id="item.id" @click="abc(item.id,item.major)" title="分享到QQ好友" ></a>
<a href="#" class="bds_qzone" data-cmd="qzone" :data-id="item.id" @click="abc(item.id,item.major)" title="分享到QQ空间" ></a>
</div>
mounted: function() {
let _this = this;
this.$nextTick(function () {
_this.bbb();
})
},
methods: {
abc(id, title) {
this.ppp = id;
this.sharetitle = title;
this.bbb();
},
bbb() {
var _this = this;
window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": _this.sharetitle, "bdMini": "1", "bdMiniList": false, "bdPic": "", "bdStyle": "1", "bdSize": "24" }, "share": {} };
var s = document.createElement('script');
s.type = 'text/javascript';
s.src = '/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5);
document.body.appendChild(s);
},
当我点击分享的时候this.sharetitle的值是获取到的,为什么微博路径上title的值没有传过去呢。我断点调试的时候bdText的值是有的,但是微博分享的内容没有写进去