problem description
the use of Baidu sharing in the vue cycle is not successful. If there is no wrong message, how to deal with it? In addition, is there something wrong with Baidu sharing? Click
http://share.baidu.com/ to intermittently jump to https:. / / www.baidu.com/search/. !
related codes
</a>
</div>
</div>
</div>
</div>
methods: {
getProducts() {},
handleShare(productId, productTitle, productImage) {
const that = this;
// that.shareConfig.shareurl = `${process.env.VUE_APP_HOST}product/detail?id${productId}`;
that.shareConfig.shareurl = "http://www.baidu.com";
that.shareConfig.sharetitle = productTitle;
that.shareConfig.sharedesc = "9999";
that.shareConfig.sharepic = productImage;
},
setShareConfig(cmd, config) {
if (this.shareConfig.shareurl) {
config.bdUrl = this.shareConfig.shareurl;
}
if (this.shareConfig.sharetitle) {
config.bdText = this.shareConfig.sharetitle;
}
console.log(config);
return config;
},
},
mounted() {
const that = this;
that.getProducts();
that.$nextTick(() => {
window._bd_share_config = {
common: {
onBeforeClick: that.setShareConfig,
},
share: {},
image: {
viewList: ["qzone", "tsina", "tqq", "renren", "weixin"],
viewText: ":",
viewSize: "16",
},
selectShare: {
bdContainerClass: null,
bdSelectMiniList: ["qzone", "tsina", "tqq", "renren", "weixin"],
},
};
const s = document.createElement("script");
s.type = "text/javascript";
s.src = `http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=${~(-new Date() / 36e5)}`;
document.body.appendChild(s);
});
},
what result do you expect? What is the error message actually seen?
Weibo icon, qq icon, etc. related to sharing can be called up, but there is no response when clicked?