Skip to content

Commit 722a375

Browse files
author
shangbin
committed
fix: init js code bug
1 parent 2439ab2 commit 722a375

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/components-v2/VCC.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,14 @@ const keymaster = require('keymaster');
7676
7777
export default {
7878
name: "vcc",
79-
props: ['initCodeEntity'],
79+
props: {
80+
initCodeEntity: {
81+
type: Object,
82+
default: () => {
83+
return {};
84+
}
85+
}
86+
},
8087
components: {
8188
RawComponents: () => import("../components/RawComponents"),
8289
ToolsBar: () => import("./ToolsBar"),
@@ -189,7 +196,7 @@ export default {
189196
this.currentEditRawInfo = null;
190197
}).onSelectElement(rawInfo => {
191198
this.currentEditRawInfo = rawInfo;
192-
}).saveJSCodeOnly(this.convertLogicCode(this.initCodeEntity.JSCode))
199+
}).saveJSCodeOnly(this.convertLogicCode(this.initCodeEntity.JSCode ? this.initCodeEntity.JSCode : ''))
193200
.render(this.initCodeEntity.codeStructure ? this.initCodeEntity.codeStructure : this.getFakeData());
194201
},
195202

0 commit comments

Comments
 (0)