Skip to content

Commit 246dae5

Browse files
committed
fix: better error management in Preview
1 parent 0d1cd59 commit 246dae5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Preview.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div>
33
<div style="color:red" v-if="error">{{this.error}}</div>
4-
<VuePreview :id="scope"/>
4+
<VuePreview v-if="!error" :id="scope"/>
55
</div>
66
</template>
77

@@ -95,7 +95,9 @@ export default {
9595
addScopedStyle(style, this.scope);
9696
}
9797
98-
this.$options.components.VuePreview = data;
98+
if (data.template || data.render) {
99+
this.$options.components.VuePreview = data;
100+
}
99101
}
100102
}
101103
};

0 commit comments

Comments
 (0)