Google Ads (#6)

This commit is contained in:
Geometrically
2020-09-01 11:30:09 -07:00
committed by GitHub
parent 749ae3deb3
commit adf780d25b
3 changed files with 55 additions and 7 deletions

38
components/GoogleAd.vue Normal file
View File

@@ -0,0 +1,38 @@
<template>
<ins
class="adsbygoogle"
:data-ad-client="adClient"
:data-ad-slot="adSlot"
:data-ad-format="adFormat"
:style="adStyle"
></ins>
</template>
<script>
export default {
name: 'GoogleAd',
props: {
adClient: {
type: String,
required: true,
},
adSlot: {
type: String,
required: true,
},
adFormat: {
type: String,
required: false,
default: 'auto',
},
adStyle: {
type: String,
required: false,
default: 'display: block',
},
},
mounted() {
;(window.adsbygoogle = window.adsbygoogle || []).push({})
},
}
</script>