diff --git a/site/components/layout.vue b/site/components/layout.vue index a3e6aafac..3ff6ec14f 100644 --- a/site/components/layout.vue +++ b/site/components/layout.vue @@ -10,7 +10,7 @@ import sortBy from 'lodash/sortBy'; import { isZhCN } from '../util'; import { Provider, create } from '../../components/_util/store'; import NProgress from 'nprogress'; -import MobileMenu from '../../components/vc-drawer/src'; +import MobileMenu from '../../components/vc-drawer/src'; const docsList = [ { key: 'introduce', enTitle: 'Ant Design of Vue', title: 'Ant Design of Vue' }, @@ -155,6 +155,15 @@ export default { mountedCallback () { NProgress.done(); document.documentElement.scrollTop = 0; + try { + document.getElementById('ad').innerHTML = ''; + const src = '//cdn.carbonads.com/carbon.js?serve=CK7DL2JW&placement=vuecomponentgithubio'; + const hm = document.createElement('script'); + hm.src = src; + hm.id = '_carbonads_js'; + const s = document.getElementById('ad'); + s.append(hm); + } catch (error) {} }, }, @@ -224,7 +233,7 @@ export default { } const config = AllDemo[titleMap[reName]]; this.resetDocumentTitle(config, reName, isCN); - const { showSideBars, isMobile } = this; + const { isMobile } = this; return (
diff --git a/site/index.html b/site/index.html index f2629a1df..ac58c493e 100644 --- a/site/index.html +++ b/site/index.html @@ -16,6 +16,43 @@ display: none; } + +
+ - \ No newline at end of file + diff --git a/site/index.less b/site/index.less index c6b79221d..89ce6915d 100644 --- a/site/index.less +++ b/site/index.less @@ -171,3 +171,13 @@ text-align: center; } } +.toc-affix { + width: 120px; + position: fixed; + top: 100px; + right: 10px; + bottom: 250px; +} +.toc-affix .ant-anchor-wrapper { + max-height: calc(~'100vh - 350px') !important; +}