diff --git a/CSDN博文备份/VueGoogle广告的配置-143066260.md b/CSDN博文备份/VueGoogle广告的配置-143066260.md new file mode 100644 index 0000000..25562d7 --- /dev/null +++ b/CSDN博文备份/VueGoogle广告的配置-143066260.md @@ -0,0 +1 @@ +

前置条件:已经在Google AdSense 中 添加网站 并通过审核 同时已创建广告单元。


因 VUE 的 Script 配置问题,所以不能直接拷贝内容。


index.html 配置


添加 Google 广告的脚本。



//index.template.html
/* *
在head标签中添加 script
【 **** 】:你的发布商 ID
*/



//index.template.html
//在body标签中为window添加函数









2024-10-18_19-58-39




组件中


组件中添加应用。



onMounted(() => {
window.googlAdsense();
});



2024-10-18_20-00-52



为广告添加占位符。



//将广告单元代码添加到盒子中




2024-10-18_20-00-16


https://www.isharkfly.com/t/vue-google/16438/1


\ No newline at end of file