File tree Expand file tree Collapse file tree 1 file changed +39
-29
lines changed Expand file tree Collapse file tree 1 file changed +39
-29
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div
3
- v-show = " visible "
3
+ v-if = " isEffective(effectiveTime) "
4
4
id =" geektime-ads"
5
5
:class =" isMobile ? 'geektime-ads-mobile':''"
6
6
>
7
7
<a
8
- href =" https://time.geekbang.org/course /intro/163?code=KHKYcoBU6vZa8nMglg7AWfDxxi3BWrz9INAzAY3umPk%3D "
8
+ href =" https://time.geekbang.org/column /intro/216?utm_term=zeusH8E0I&utm_source=website&utm_medium=tangjinzhou "
9
9
target =" _blank"
10
10
>
11
11
<img
12
12
height =" 100"
13
- alt =" Vue 实战教程 "
14
- src =" https://cdn.nlark.com/yuque/0/2019/jpeg/87084/1562230861353 -assets/web-upload/2fab2df7-5cc9-4791-b344-a97da29eb400 .jpeg"
15
- >
13
+ alt =" 浏览器工作原理与实践 "
14
+ src =" https://cdn.nlark.com/yuque/0/2019/jpeg/87084/1564994550991 -assets/web-upload/fd11d2ba-7351-47d5-bf87-aa9eb2a10256 .jpeg"
15
+ / >
16
16
</a >
17
17
</div >
18
18
</template >
19
19
20
20
<script >
21
+ import moment from ' moment' ;
21
22
export default {
22
23
props: [' isMobile' ],
23
24
data () {
24
25
return {
25
26
visible: true ,
27
+ effectiveTime: {
28
+ start: ' 2019-08-05 17:00:00' ,
29
+ end: ' 2019-09-05 17:00:00' ,
30
+ },
26
31
};
27
32
},
33
+ methods: {
34
+ isEffective ({ start, end }) {
35
+ return moment ().isBetween (start, end);
36
+ },
37
+ },
28
38
};
29
39
</script >
30
40
31
41
<style lang="less" scoped>
32
- #geektime-ads {
33
- max-width : 280px ;
34
- height : 100px ;
35
- float : right ;
36
- position : relative ;
37
- right : 0 ;
38
- bottom : 0 ;
39
- padding : 0 ;
40
- overflow : hidden ;
41
- z-index : 9 ;
42
- background-color : #fff ;
43
- border-radius : 3px ;
44
- font-size : 13px ;
45
- background : #f5f5f5 ;
46
- font-family : " Source Sans Pro" , " Helvetica Neue" , Arial , sans-serif ;
47
- }
48
- #geektime-ads .geektime-ads-mobile {
49
- width : 100% ;
50
- position : relative ;
51
- right : 0 ;
52
- bottom : 0 ;
53
- padding : 0 ;
54
- margin-bottom : 15px ;
55
- }
42
+ #geektime-ads {
43
+ max-width : 280px ;
44
+ height : 100px ;
45
+ float : right ;
46
+ position : relative ;
47
+ right : 0 ;
48
+ bottom : 0 ;
49
+ padding : 0 ;
50
+ overflow : hidden ;
51
+ z-index : 9 ;
52
+ background-color : #fff ;
53
+ border-radius : 3px ;
54
+ font-size : 13px ;
55
+ background : #f5f5f5 ;
56
+ font-family : ' Source Sans Pro' , ' Helvetica Neue' , Arial , sans-serif ;
57
+ }
58
+ #geektime-ads .geektime-ads-mobile {
59
+ width : 100% ;
60
+ position : relative ;
61
+ right : 0 ;
62
+ bottom : 0 ;
63
+ padding : 0 ;
64
+ margin-bottom : 15px ;
65
+ }
56
66
</style >
57
67
You can’t perform that action at this time.
0 commit comments