Skip to content

Commit 5a4ac16

Browse files
author
shangbin
committed
update: 支持下载html文件
1 parent 8bc06d5 commit 5a4ac16

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/components/Code.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
<CodeEditor v-if="codeDialogVisible" style="max-height: 65vh;" ref="codeEditor" :initCode="outputCode"
55
mode="text/html"></CodeEditor>
66
<div style="color: #666; font-size: 12px; text-align:center; margin: 5px;">使用代码前请确认相应的组件库已集成至项目</div>
7-
<div style="text-aligin:center;">
7+
<div style="text-align:center;">
88
<el-row>
99
<el-col :span="12">
10+
输出形式:
1011
<el-radio-group v-model="outputMode">
1112
<el-radio label="vue">Vue</el-radio>
1213
<el-radio label="html">单页Html</el-radio>
@@ -79,7 +80,12 @@ export default {
7980
let blob = new Blob([this.outputCode], {
8081
type: "text/plain;charset=utf-8",
8182
});
82-
saveAs(blob, "VueComponent.vue");
83+
84+
if (this.isVueMode) {
85+
saveAs(blob, "VueComponent.vue");
86+
} else {
87+
saveAs(blob, "vcc.html");
88+
}
8389
},
8490
8591
},

0 commit comments

Comments
 (0)