Skip to content

Commit ff7b679

Browse files
committed
docs: support configure preview link for Previewer component
1 parent 63fcb93 commit ff7b679

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

docs/.vuepress/theme/components/Previewer.vue

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<template>
22
<div class="previewer">
3-
<div class="content"></div>
3+
<div class="previewer-content">
4+
<!-- add a wrapper to prevent overflow hidden property effect box-shadow -->
5+
<div class="iframe-wrapper" v-if="$page.frontmatter.previewLink">
6+
<iframe :src="$page.frontmatter.previewLink" frameborder="0" width="100%" height="100%"></iframe>
7+
</div>
8+
</div>
49
</div>
510
</template>
611

@@ -21,7 +26,7 @@ export default {
2126
height $s-preview-width * $ratio
2227
background url('../assets/images/16th-mockup.png') no-repeat center/100%
2328
24-
.content
29+
.previewer-content
2530
$s-vertical = 28px
2631
$s-horizontal = 11px
2732
@@ -34,4 +39,11 @@ export default {
3439
background-color #fff
3540
box-shadow 0 0 0 1.5px rgba(0,0,0,0.8)
3641
border-radius 32px
42+
43+
.iframe-wrapper
44+
position relative
45+
width 100%
46+
height 100%
47+
border-radius 32px
48+
overflow hidden
3749
</style>

0 commit comments

Comments
 (0)