This commit is contained in:
huanqing.shao
2019-10-31 19:26:22 +08:00
parent e2b5ddc583
commit 005a047d3c
26 changed files with 622 additions and 71 deletions

View File

@ -1,6 +1,6 @@
<template>
<div :style="$isDev ? 'background-color: #grey;' : ''">
<div class="ads" v-if="!$frontmatter.lessAds && $themeConfig.showAds && !isSharing">
<div class="ads" v-if="!$frontmatter.lessAds && $themeConfig.showAds && isNotSharing">
<div>
<a @click="clickAds" :href="random.url" target="_blank" rel="nofollow" style="text-decoration: none;">
<span class="name">
@ -40,13 +40,16 @@ export default {
data () {
return {
ads: require('./ad-list'),
isSharing: false
isNotSharing: false
}
},
mounted () {
if (typeof window !== 'undefined') {
if (location.search !== undefined && location.search.indexOf('sharing') >= 0) {
this.isSharing = true
// 如果带参数 sharing则设置 isSharing = true
this.$set(this, 'isNotSharing', false)
} else {
this.$set(this, 'isNotSharing', true)
}
}
},