File tree Expand file tree Collapse file tree 5 files changed +63
-1
lines changed Expand file tree Collapse file tree 5 files changed +63
-1
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,7 @@ export default {
158
158
" componentChildrenMultiselectValue" ,
159
159
" imagePath" ,
160
160
" activeComponentObj" ,
161
+ " exportAsTypescript" ,
161
162
]),
162
163
// used in VueDraggableResizeable component
163
164
activeRouteArray () {
Original file line number Diff line number Diff line change @@ -161,7 +161,14 @@ export default {
161
161
methods += " },\n " ;
162
162
}
163
163
// concat all code within script tags
164
- let output = " \n\n <script>\n " ;
164
+ // if exportAsTypescript is on, out should be <script lang="ts">
165
+ console .log (" export as typescript:" , this .exportAsTypescript );
166
+ let output;
167
+ if (this .exportAsTypescript === ' on' ) {
168
+ output = " \n\n <script lang='ts'>\n " ;
169
+ } else {
170
+ output = " \n\n <script>\n " ;
171
+ }
165
172
output += imports + " \n export default {\n name: '" + componentName + " '" ;
166
173
output += " ,\n components: {\n " ;
167
174
output += childrenComponentNames + " },\n " ;
@@ -170,6 +177,7 @@ export default {
170
177
output += methods;
171
178
// eslint-disable-next-line no-useless-escape
172
179
output += " };\n <\/ script>" ;
180
+ console .log (' output' , output);
173
181
return output;
174
182
},
175
183
/**
Original file line number Diff line number Diff line change @@ -186,6 +186,7 @@ export default {
186
186
" activeComponent" ,
187
187
" activeComponentObj" ,
188
188
" componentMap" ,
189
+ " exportAsTypescript" ,
189
190
]),
190
191
191
192
activeRouteDisplay () {
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+ </div >
4
+ </template >
5
+
6
+ <script lang='ts'>
7
+ import { mapState , mapActions } from " vuex" ;
8
+ // need to add import defineComponent
9
+ import { defineComponent } from " vue" ;
10
+
11
+ export default defineComponent ({
12
+ name: ' TestContainer' ,
13
+ components: {
14
+ },
15
+ data () {
16
+ return {
17
+ testProp: " PLACEHOLDER FOR VALUE" ,
18
+ }
19
+ },
20
+ computed: {
21
+ ... mapState ([
22
+ " testState" ,
23
+ ]),
24
+ },
25
+ methods: {
26
+ ... mapActions ([
27
+ " testAction" ,
28
+ ]),
29
+ },
30
+ });
31
+ </script >
32
+
33
+ <style scoped>
34
+ </style >
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+ </div >
4
+ </template >
5
+
6
+ <script lang='ts'>
7
+ import Child from ' @/components/Child.vue' ;
8
+
9
+ export default {
10
+ name: ' Test' ,
11
+ components: {
12
+ Child ,
13
+ },
14
+ };
15
+ </script >
16
+
17
+ <style scoped>
18
+ </style >
You can’t perform that action at this time.
0 commit comments