3
3
:center =true >
4
4
<CodeEditor style =" max-height : 65vh ;" ref =" codeEditor" :initCode =" code" mode =" text/javascript" ></CodeEditor >
5
5
6
- <div style =" text-align :center ;padding : 10px ;" >
7
- <el-button type =" primary" @click =" onSave" >确认修改</el-button >
8
- <div style =" color : #6c6c6c ; font-size :12px ; margin-top :5px ;" >Tips: 确认修改之后将会影响最终生成的代码逻辑</div >
9
- <div v-if =" error" style =" color : red ; font-size :12px ; margin-top :5px ;" >请检查语法错误:{{error}}</div >
6
+ <div style =" padding : 10px ; display :flex ;justify-content : flex-end ;align-items : center ;" >
7
+ <div >
8
+ <el-button type =" primary" @click =" onSave" >确认修改</el-button >
9
+ <div v-if =" error" style =" color : red ; font-size :12px ; margin-top :5px ;" >请检查语法错误:{{error}}</div >
10
+ </div >
11
+
12
+ <div style =" margin-left : 5px ;" >
13
+ <el-link href =" https://vcc.sahadev.tech/doc/#/improve/logic?id=%e9%80%bb%e8%be%91%e6%a8%a1%e6%9d%bf"
14
+ target =" _blank" icon =" el-icon-question" >帮助与说明</el-link >
15
+ <div style =" color : #6c6c6c ; font-size :12px ; margin-top :5px ;" >Tips: 建议看一下使用说明</div >
16
+ </div >
10
17
</div >
11
18
</el-dialog >
12
19
@@ -19,26 +26,14 @@ import CodeEditor from './CodeEditor.vue'
19
26
import prettier from " prettier/standalone" ;
20
27
import babel from " prettier/parser-babel" ;
21
28
22
- export default {
23
- props: [' codeDialogVisible' ],
24
- components: {
25
- CodeEditor
26
- },
27
-
28
- data () {
29
- return {
30
- error: ' ' ,
31
- code: dedent`
29
+ const example = dedent`
32
30
/**
33
31
* 以下代码中的方法会被注入到最终的代码中,如果命名与源代码有相同的,则会替换源代码
34
32
* 内部集成了axios,开发者可以直接通过axios发起网络请求,不过接口需要允许跨域。
35
33
* 可以通过https://apis.sahadev.tech/exchange?url=的方式访问实际地址可以解决跨域问题。
36
34
* axios官方文档:https://www.npmjs.com/package/axios
37
35
*/
38
36
{
39
- props: [],
40
- components: {},
41
-
42
37
data() {
43
38
return {
44
39
@@ -57,25 +52,20 @@ export default {
57
52
axios.get('https://apis.sahadev.tech/exchange?url=https://www.baidu.com').then(res => console.info(res), err => console.error(err));
58
53
}
59
54
},
60
-
61
- // 生命周期 start
62
- beforeCreate() {},
63
- created() {},
64
-
65
- beforeMount() {},
66
- mounted() {},
67
-
68
- beforeUpdate() {},
69
- updated() {},
70
-
71
- beforeDestory() {},
72
- destoryed() {},
73
- // 生命周期 end
74
-
75
- fillter: {},
76
55
};
77
-
78
56
`
57
+
58
+ export default {
59
+ props: [' codeDialogVisible' ],
60
+ components: {
61
+ CodeEditor
62
+ },
63
+
64
+ data () {
65
+ return {
66
+ error: ' ' ,
67
+ code: example,
68
+ example: ` ${ example} `
79
69
};
80
70
},
81
71
beforeCreate () { },
0 commit comments