2019-10-31 11:42:49 +00:00
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
mounted() {
|
|
|
|
this.load();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
load() {
|
|
|
|
if (this.scriptDom) {
|
|
|
|
this.$el.removeChild(this.scriptDom);
|
|
|
|
}
|
|
|
|
this.$refs.ins.innerHTML = '';
|
|
|
|
const e = document.createElement('script');
|
|
|
|
e.src = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';
|
|
|
|
e.async = true;
|
|
|
|
this.$el.appendChild(e);
|
|
|
|
this.scriptDom = e;
|
2019-11-07 09:49:17 +00:00
|
|
|
(window.adsbygoogle = window.adsbygoogle || []).push({});
|
2019-10-31 11:42:49 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
render() {
|
|
|
|
return (
|
2019-11-16 09:23:03 +00:00
|
|
|
<div class="google-ads" id="api">
|
2019-10-31 11:42:49 +00:00
|
|
|
<ins
|
|
|
|
ref="ins"
|
|
|
|
class="adsbygoogle"
|
|
|
|
style="display:block"
|
|
|
|
data-ad-client="ca-pub-4801326429087140"
|
|
|
|
data-ad-slot="7647023136"
|
|
|
|
data-ad-format="auto"
|
|
|
|
data-full-width-responsive="true"
|
|
|
|
></ins>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|