show ad in mobile

This commit is contained in:
naiba 2023-10-24 18:11:02 +08:00
parent 68f95380ca
commit 71a90db115
4 changed files with 23 additions and 6 deletions

View File

@ -0,0 +1,15 @@
<template>
<div v-if="show" class="wwads-cn wwads-horizontal" data-id="296"></div>
</template>
<script>
export default {
data() {
return {
show: false
}
},
mounted() {
this.show = navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i)
}
}
</script>

View File

@ -1,3 +0,0 @@
<template>
<div class="wwads-cn wwads-vertical" data-id="296" style="max-width:350px; margin-bottom: 20px;"></div>
</template>

View File

@ -0,0 +1,3 @@
<template>
<div class="wwads-cn wwads-vertical" data-id="296" style="margin-bottom: 20px;"></div>
</template>

View File

@ -1,12 +1,14 @@
import { h } from 'vue' import { h } from 'vue'
import DefaultTheme from 'vitepress/theme' import DefaultTheme from 'vitepress/theme'
import SmallAd from './components/SmallAd.vue' import HorizontalAd from './components/HorizontalAd.vue'
import VerticalAd from './components/VerticalAd.vue'
export default { export default {
...DefaultTheme, ...DefaultTheme,
Layout() { Layout() {
return h(DefaultTheme.Layout, null, { return h(DefaultTheme.Layout, null, {
'aside-top': () => h(SmallAd) 'doc-top': () => h(HorizontalAd),
'aside-top': () => h(VerticalAd),
}) })
} }
} }