用的网上的解决方法是,Github地址:https://github.com/hrwhisper/...,
把这个克隆到本地放在了文件里,并且在代码中引入,但是报错了
if (!this.hasBaidu) {
this.hasBaidu = true;
window._bd_share_config = {
common: {
bdText: document.title,
bdUrl: window.location.href,
},
share: [{
tag: "share_0",
bdSize: 24
}],
};
const 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);
}
点击后报错_id.vue?64e7:349 GET http://127.0.0.1:3000/static/api/js/share.js?v=89860593.js?cdnversion=424185 404 (OK)
http://127.0.0.1:3000,这个是vue里配置的通用头部,不知道它怎么就加上里
这明显是找不到share.js这个文件,你代码下载下来放的路径是啥