1
1
<script >
2
2
import axios from ' axios' ;
3
3
const 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' ,
7
10
' vue.ant.design' : ' //cdn.carbonads.com/carbon.js?serve=CK7DL2JW&placement=vueantdesign' ,
8
11
};
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' ;
10
15
export default {
11
16
props: {
12
17
isMobile: Boolean ,
@@ -17,18 +22,17 @@ export default {
17
22
// if(isGitee) {
18
23
// adId = '#cf';
19
24
// }
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 = ' ' ;
22
27
this .load ();
23
28
}
24
29
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 = ' ' ;
28
33
this .load ();
29
34
}
30
35
}, 20000 );
31
-
32
36
},
33
37
},
34
38
mounted () {
@@ -41,35 +45,35 @@ export default {
41
45
// .then(function (response) {
42
46
// document.getElementById("codefund-ads").innerHTML = response.data;
43
47
// });
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' ;
48
52
e .src = carbonUrl;
49
53
this .$el .appendChild (e);
50
54
}
51
55
},
52
56
},
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' : ' ' } / > ;
57
59
},
58
60
};
59
61
</script >
60
62
<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 ;
66
69
padding : 0 ;
67
70
overflow : hidden ;
68
71
z-index : 9 ;
69
72
background-color : #fff ;
73
+ border-radius : 3px ;
70
74
font-size : 13px ;
71
75
background : #f5f5f5 ;
72
- font-family : " Source Sans Pro" , " Helvetica Neue" , Arial , sans-serif ;
76
+ font-family : ' Source Sans Pro' , ' Helvetica Neue' , Arial , sans-serif ;
73
77
}
74
78
#carbonads {
75
79
overflow : hidden ;
@@ -100,9 +104,9 @@ export default {
100
104
overflow : hidden ;
101
105
}
102
106
#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 ;
106
110
margin-top : 6px ;
107
111
}
108
112
#carbon-ads .carbon-mobile {
0 commit comments