11<script >
22import axios from ' axios' ;
33const carbonUrls = {
4- ' vuecomponent.github.io' : ' //cdn.carbonads.com/carbon.js?serve=CK7DL2JW&placement=vuecomponentgithubio' ,
5- ' tangjinzhou.gitee.io' : ' //cdn.carbonads.com/carbon.js?serve=CK7DL2JN&placement=tangjinzhougiteeio' ,
6- ' ant-design-vue.gitee.io' : ' //cdn.carbonads.com/carbon.js?serve=CK7DL2JN&placement=antdesignvuegiteeio' ,
4+ ' vuecomponent.github.io' :
5+ ' //cdn.carbonads.com/carbon.js?serve=CK7DL2JW&placement=vuecomponentgithubio' ,
6+ ' tangjinzhou.gitee.io' :
7+ ' //cdn.carbonads.com/carbon.js?serve=CK7DL2JN&placement=tangjinzhougiteeio' ,
8+ ' ant-design-vue.gitee.io' :
9+ ' //cdn.carbonads.com/carbon.js?serve=CK7DL2JN&placement=antdesignvuegiteeio' ,
710 ' vue.ant.design' : ' //cdn.carbonads.com/carbon.js?serve=CK7DL2JW&placement=vueantdesign' ,
811};
9- const carbonUrl = carbonUrls[location .host ] || ' //cdn.carbonads.com/carbon.js?serve=CK7DL2JW&placement=vueantdesign' ;
12+ const carbonUrl =
13+ carbonUrls[location .host ] ||
14+ ' //cdn.carbonads.com/carbon.js?serve=CK7DL2JW&placement=vueantdesign' ;
1015export default {
1116 props: {
1217 isMobile: Boolean ,
@@ -17,18 +22,17 @@ export default {
1722 // if(isGitee) {
1823 // adId = '#cf';
1924 // }
20- if (e .path !== t .path && this .$el .querySelector (adId)){
21- this .$el .innerHTML = " " ;
25+ if (e .path !== t .path && this .$el .querySelector (adId)) {
26+ this .$el .innerHTML = ' ' ;
2227 this .load ();
2328 }
2429 this .adInterval && clearInterval (this .adInterval );
25- this .adInterval = setInterval (()=> {
26- if (! this .$el .querySelector (adId)){
27- this .$el .innerHTML = " " ;
30+ this .adInterval = setInterval (() => {
31+ if (! this .$el .querySelector (adId)) {
32+ this .$el .innerHTML = ' ' ;
2833 this .load ();
2934 }
3035 }, 20000 );
31-
3236 },
3337 },
3438 mounted () {
@@ -41,35 +45,35 @@ export default {
4145 // .then(function (response) {
4246 // document.getElementById("codefund-ads").innerHTML = response.data;
4347 // });
44- // } else
45- if (carbonUrl) {
46- const e = document .createElement (" script" );
47- e .id = " _carbonads_js" ;
48+ // } else
49+ if (carbonUrl) {
50+ const e = document .createElement (' script' );
51+ e .id = ' _carbonads_js' ;
4852 e .src = carbonUrl;
4953 this .$el .appendChild (e);
5054 }
5155 },
5256 },
53- render () {
54- return (
55- < div id= " carbon-ads" class = {this .isMobile ? ' carbon-mobile' : ' ' }/ >
56- );
57+ render () {
58+ return < div id= " carbon-ads" class = {this .isMobile ? ' carbon-mobile' : ' ' } / > ;
5759 },
5860};
5961 </script >
6062<style lang="less">
61- #carbon-ads {
62- width : 266px ;
63- position : fixed ;
64- left : 0 ;
65- bottom : 0px ;
63+ #carbon-ads {
64+ width : 280px ;
65+ float : right ;
66+ position : relative ;
67+ right : 0 ;
68+ bottom : 0 ;
6669 padding : 0 ;
6770 overflow : hidden ;
6871 z-index : 9 ;
6972 background-color : #fff ;
73+ border-radius : 3px ;
7074 font-size : 13px ;
7175 background : #f5f5f5 ;
72- font-family : " Source Sans Pro" , " Helvetica Neue" , Arial , sans-serif ;
76+ font-family : ' Source Sans Pro' , ' Helvetica Neue' , Arial , sans-serif ;
7377}
7478#carbonads {
7579 overflow : hidden ;
@@ -100,9 +104,9 @@ export default {
100104 overflow : hidden ;
101105}
102106#carbon-ads .carbon-poweredby {
103- color : #aaa ;
104- font-weight : normal ;
105- line-height : 1.2 ;
107+ color : #aaa ;
108+ font-weight : normal ;
109+ line-height : 1.2 ;
106110 margin-top : 6px ;
107111}
108112#carbon-ads .carbon-mobile {
0 commit comments