Skip to content

Commit 9f25df8

Browse files
committed
fix: only apply iframe for demos with browser window
1 parent fa9468a commit 9f25df8

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

components/OneLive.vue

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@
6868
'live-preview-browser': browser
6969
}"
7070
>
71-
<one-iframe global-style="body { margin: 0 !important; } body > article { margin: 24px 36px; } .veui-layout { min-width: auto !important; }">
71+
<one-iframe
72+
v-if="browser"
73+
global-style="body { margin: 0 !important; } body > article { margin: 24px 36px; } .veui-layout { min-width: auto !important; }"
74+
>
7275
<v-live-preview
7376
class="editor-preview"
7477
:code="transformedCode"
@@ -78,6 +81,15 @@
7881
@error="handleError"
7982
/>
8083
</one-iframe>
84+
<v-live-preview
85+
v-else
86+
class="editor-preview"
87+
:code="transformedCode"
88+
:requires="imports"
89+
:check-variable-availability="false"
90+
@success="dismissError"
91+
@error="handleError"
92+
/>
8193
<transition name="editor-error">
8294
<veui-alert
8395
v-if="error"

components/OneRepl.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ Icon.register({
121121
flex 1 1 auto
122122
height calc(100% - 48px)
123123
124+
& >>> .live-preview
125+
padding 24px 36px
126+
124127
& >>> .VueLive-error
125128
display none
126129

0 commit comments

Comments
 (0)