File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed
docs/.vuepress/theme/components Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" previewer" >
3
+ <a
4
+ class =" edit-link"
5
+ target =" _blank"
6
+ v-if =" !$page.frontmatter.home && $page.frontmatter.previewLink"
7
+ :href =" editLink" >
8
+ Edit in JSFiddle
9
+ </a >
3
10
<div class =" previewer-content" >
4
11
<!-- add a wrapper to prevent overflow hidden property effect box-shadow -->
5
12
<div class =" iframe-wrapper" v-if =" $page.frontmatter.previewLink" >
6
- <iframe :src =" $page.frontmatter.previewLink" frameborder =" 0" width = " 100% " height = " 100% " ></iframe >
13
+ <iframe :src =" $page.frontmatter.previewLink" frameborder =" 0" ></iframe >
7
14
</div >
8
15
</div >
9
16
</div >
12
19
<script >
13
20
export default {
14
21
name: ' Previewer' ,
22
+ computed: {
23
+ editLink () {
24
+ return this .$page .frontmatter .previewLink && this .$page .frontmatter .previewLink .replace (/ embedded. * $ / , ' ' );
25
+ },
26
+ },
15
27
};
16
28
</script >
17
29
@@ -26,6 +38,17 @@ export default {
26
38
height $s-preview-width * $ratio
27
39
background url ('../assets/images/16th-mockup.png' ) no-repeat center / 100%
28
40
41
+ .edit-link
42
+ position absolute
43
+ top 94px
44
+ right 100%
45
+ font-size 0.9rem
46
+ font-weight normal
47
+ writing-mode vertical - lr
48
+
49
+ & :not (:hover )
50
+ color #c c c
51
+
29
52
.previewer-content
30
53
$s-vertical = 28px
31
54
$s-horizontal = 11px
@@ -46,4 +69,9 @@ export default {
46
69
height 100%
47
70
border-radius 32px
48
71
overflow hidden
72
+
73
+ iframe
74
+ margin-top - 50px
75
+ width 100%
76
+ height calc (100% + 50px )
49
77
</style >
You can’t perform that action at this time.
0 commit comments