show ad in mobile
This commit is contained in:
parent
68f95380ca
commit
71a90db115
15
docs/.vitepress/theme/components/HorizontalAd.vue
Normal file
15
docs/.vitepress/theme/components/HorizontalAd.vue
Normal 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>
|
@ -1,3 +0,0 @@
|
||||
<template>
|
||||
<div class="wwads-cn wwads-vertical" data-id="296" style="max-width:350px; margin-bottom: 20px;"></div>
|
||||
</template>
|
3
docs/.vitepress/theme/components/VerticalAd.vue
Normal file
3
docs/.vitepress/theme/components/VerticalAd.vue
Normal file
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<div class="wwads-cn wwads-vertical" data-id="296" style="margin-bottom: 20px;"></div>
|
||||
</template>
|
@ -1,12 +1,14 @@
|
||||
import { h } from 'vue'
|
||||
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 {
|
||||
...DefaultTheme,
|
||||
Layout() {
|
||||
return h(DefaultTheme.Layout, null, {
|
||||
'aside-top': () => h(SmallAd)
|
||||
'doc-top': () => h(HorizontalAd),
|
||||
'aside-top': () => h(VerticalAd),
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user