forked from LaconicNetwork/cosmos-explorer
disable ad
This commit is contained in:
parent
49f7564f6c
commit
a15a3ace8e
@ -1,30 +1,3 @@
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { getClient, getUnit } from './ad';
|
||||
|
||||
const props = defineProps({
|
||||
id: { type: String, required: true},
|
||||
unit: { type: String, required: true},
|
||||
width: { type: String },
|
||||
height: { type: String },
|
||||
});
|
||||
|
||||
const show = ref(false)
|
||||
onMounted(() => {
|
||||
const adClient = getClient();
|
||||
const adUnitId = getUnit(props.unit);
|
||||
show.value = adClient !== undefined && adUnitId !== undefined;
|
||||
|
||||
if(show.value) {
|
||||
adClient.showBannerAd({
|
||||
adUnitId,
|
||||
containerId: props.id,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<div v-show="show" :id="id" :unit="unit" class="grid justify-items-center overflow-auto pt-4">
|
||||
</div>
|
||||
<div></div>
|
||||
</template>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user