docs: update ad doc

pull/1845/head
tangjinzhou 2020-02-26 19:57:31 +08:00
parent 93cf802b51
commit 05658b7165
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="markdown api-container"> <div class="markdown api-container">
<GoogleAds /> <GoogleAds v-if="showAd" />
<slot v-if="isZhCN" name="cn" /> <slot v-if="isZhCN" name="cn" />
<slot v-else /> <slot v-else />
</div> </div>
@ -8,6 +8,8 @@
<script> <script>
import { isZhCN } from '../util'; import { isZhCN } from '../util';
import GoogleAds from './GoogleAds'; import GoogleAds from './GoogleAds';
const showAd = location.host.indexOf('antdv.com') > -1;
export default { export default {
name: 'Api', name: 'Api',
components: { components: {
@ -18,6 +20,7 @@ export default {
}, },
data() { data() {
return { return {
showAd,
isZhCN: isZhCN(this.demoContext.name), isZhCN: isZhCN(this.demoContext.name),
}; };
}, },

View File

@ -329,7 +329,7 @@ export default {
], ],
}} }}
></router-view> ></router-view>
<GoogleAds key={`GoogleAds_${$route.path}`} /> {showAd ? <GoogleAds key={`GoogleAds_${$route.path}`} /> : null}
</div> </div>
) : ( ) : (
'' ''