File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 22let today = new Date();
33
44< input type ="checkbox " v-model ="show ">
5- < date-picker v-if ="show " :value ="today "/>
5+ < date-picker
6+ style ="text-align:center; "
7+ v-if ="show "
8+ :value ="today "/>
Original file line number Diff line number Diff line change 11<template >
22 <div >
33 <div style =" color :red " v-if =" error" >{{this.error}}</div >
4- <VuePreview v-if =" !error" :id =" scope" />
4+ <component v-if =" !error && previewedComponent " :id =" scope" :is = " previewedComponent " />
55 </div >
66</template >
77
@@ -45,6 +45,7 @@ export default {
4545 data () {
4646 return {
4747 scope: this .generateScope (),
48+ previewedComponent: undefined ,
4849 error: false
4950 };
5051 },
@@ -114,7 +115,7 @@ export default {
114115 }
115116
116117 if (data .template || data .render ) {
117- this .$options . components . VuePreview = data;
118+ this .previewedComponent = data;
118119 }
119120 }
120121 }
You can’t perform that action at this time.
0 commit comments