lazyload
This commit is contained in:
@ -9,9 +9,9 @@
|
||||
data-ad-format="auto"
|
||||
data-full-width-responsive="true"></ins>
|
||||
<script>
|
||||
if (!window.kuboardSharing) {
|
||||
<!-- if (!window.kuboardSharing) { -->
|
||||
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||
}
|
||||
<!-- } -->
|
||||
</script>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
data-ad-format="auto"
|
||||
data-full-width-responsive="true"></ins>
|
||||
<script>
|
||||
if (!window.kuboardSharing) {
|
||||
<!-- if (!window.kuboardSharing) { -->
|
||||
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||
}
|
||||
<!-- } -->
|
||||
</script>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -1,19 +1,21 @@
|
||||
<template>
|
||||
<div v-if="$themeConfig.showAds" :style="$isDev ? 'background-color: grey;' : ''">
|
||||
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
|
||||
<!-- 正方形-正文 -->
|
||||
<ins class="adsbygoogle"
|
||||
style="display:block"
|
||||
data-ad-client="ca-pub-3313149841665250"
|
||||
data-ad-slot="9455695764"
|
||||
data-ad-format="auto"
|
||||
data-full-width-responsive="true"></ins>
|
||||
<script>
|
||||
if (!window.kuboardSharing) {
|
||||
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<LazyLoad :noAdsOnSharing="true">
|
||||
<div v-if="$themeConfig.showAds" :style="$isDev ? 'background-color: grey;' : ''">
|
||||
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
|
||||
<!-- 正方形-正文 -->
|
||||
<ins class="adsbygoogle"
|
||||
style="display:block"
|
||||
data-ad-client="ca-pub-3313149841665250"
|
||||
data-ad-slot="9455695764"
|
||||
data-ad-format="auto"
|
||||
data-full-width-responsive="true"></ins>
|
||||
<script>
|
||||
if (!window.kuboardSharing) {
|
||||
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</LazyLoad>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
@ -1,19 +1,21 @@
|
||||
<template>
|
||||
<div v-if="$themeConfig.showAds" :style="$isDev ? 'background-color: grey;' : ''">
|
||||
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
|
||||
<!-- 正文-垂直 -->
|
||||
<ins class="adsbygoogle"
|
||||
style="display:block"
|
||||
data-ad-client="ca-pub-3313149841665250"
|
||||
data-ad-slot="4549679988"
|
||||
data-ad-format="auto"
|
||||
data-full-width-responsive="true"></ins>
|
||||
<script>
|
||||
if (!window.kuboardSharing) {
|
||||
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<LazyLoad :noAdsOnSharing="true">
|
||||
<div v-if="$themeConfig.showAds" :style="$isDev ? 'background-color: grey;' : ''">
|
||||
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
|
||||
<!-- 正文-垂直 -->
|
||||
<ins class="adsbygoogle"
|
||||
style="display:block"
|
||||
data-ad-client="ca-pub-3313149841665250"
|
||||
data-ad-slot="4549679988"
|
||||
data-ad-format="auto"
|
||||
data-full-width-responsive="true"></ins>
|
||||
<script>
|
||||
if (!window.kuboardSharing) {
|
||||
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</LazyLoad>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
42
.vuepress/components/LazyLoad.vue
Normal file
42
.vuepress/components/LazyLoad.vue
Normal file
@ -0,0 +1,42 @@
|
||||
<template>
|
||||
<div v-if="load">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
noAdsOnSharing: { type: Boolean, required: false, default: false }
|
||||
},
|
||||
data () {
|
||||
let load = false
|
||||
return {
|
||||
load: load
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
setTimeout( _ => {
|
||||
if (this.noAdsOnSharing) {
|
||||
console.log('noAdsOnSharing')
|
||||
if (typeof window !== 'undefined') {
|
||||
if (this.$isSharing) {
|
||||
this.load = false
|
||||
console.log('noAdsOnSharing', this.load)
|
||||
} else {
|
||||
this.load = true
|
||||
console.log('noAdsOnSharing', this.load)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.load = true
|
||||
console.log('load', this.load)
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@ -1,29 +1,31 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-for="(item, key) in vssues" :key="key">
|
||||
<Vssue v-if="item && item > 0" v-show="key === $route.path" :issueId="item" :options="options"/>
|
||||
<div v-if="item === undefined && isLocalHost" v-show="key === $route.path" :key="key">
|
||||
<b-button variant="danger" @click="vssues[key] = ''">请创建 VssueId</b-button>
|
||||
<LazyLoad>
|
||||
<div v-for="(item, key) in vssues" :key="key">
|
||||
<Vssue v-if="item && item > 0" v-show="key === $route.path" :issueId="item" :options="options"/>
|
||||
<div v-if="item === undefined && isLocalHost" v-show="key === $route.path" :key="key">
|
||||
<b-button variant="danger" @click="vssues[key] = ''">请创建 VssueId</b-button>
|
||||
</div>
|
||||
<div v-if="item === ''">
|
||||
<b-button variant="warning" @click="refreshId = $refs.vssue[0].vssue.issue.id">请填写 vusseId <span v-if="refreshId"> - {{refreshId}}</span></b-button>
|
||||
<Vssue ref="vssue" :title="$page.path" :options="options"/>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="item === ''">
|
||||
<b-button variant="warning" @click="refreshId = $refs.vssue[0].vssue.issue.id">请填写 vusseId <span v-if="refreshId"> - {{refreshId}}</span></b-button>
|
||||
<Vssue ref="vssue" :title="$page.path" :options="options"/>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
var bp = document.createElement('script');
|
||||
var curProtocol = window.location.protocol.split(':')[0];
|
||||
if (curProtocol === 'https') {
|
||||
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
|
||||
}
|
||||
else {
|
||||
bp.src = 'http://push.zhanzhang.baidu.com/push.js';
|
||||
}
|
||||
var s = document.getElementsByTagName('script')[0];
|
||||
s.parentNode.insertBefore(bp, s);
|
||||
})();
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
var bp = document.createElement('script');
|
||||
var curProtocol = window.location.protocol.split(':')[0];
|
||||
if (curProtocol === 'https') {
|
||||
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
|
||||
}
|
||||
else {
|
||||
bp.src = 'http://push.zhanzhang.baidu.com/push.js';
|
||||
}
|
||||
var s = document.getElementsByTagName('script')[0];
|
||||
s.parentNode.insertBefore(bp, s);
|
||||
})();
|
||||
</script>
|
||||
</LazyLoad>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
<template>
|
||||
<a aria-label="github" @click="$sendGaEvent('ViewGitHubStar', 'ViewGitHubStarNav', 'ViweGitHubStar:' + $page.path)">
|
||||
<iframe style="display:inline-block;vertical-align:middle;" src="https://ghbtns.com/github-btn.html?user=eip-work&repo=kuboard-press&type=star&count=true&size=small" frameborder="0" scrolling="0" width="100px" height="20px"></iframe>
|
||||
</a>
|
||||
<div style="display: inline-block; width: 100px;">
|
||||
<LazyLoad>
|
||||
<a aria-label="github" @click="$sendGaEvent('ViewGitHubStar', 'ViewGitHubStarNav', 'ViweGitHubStar:' + $page.path)">
|
||||
<iframe style="display:inline-block;vertical-align:middle;" src="https://ghbtns.com/github-btn.html?user=eip-work&repo=kuboard-press&type=star&count=true&size=small" frameborder="0" scrolling="0" width="100px" height="20px"></iframe>
|
||||
</a>
|
||||
</LazyLoad>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
Reference in New Issue
Block a user