@@ -41,9 +41,6 @@ export default {
41
41
computed: {
42
42
// needs access to current component aka activeComponent
43
43
... mapState ([' componentMap' , ' activeComponent' , ' activeComponentObj' ]),
44
- activeObj (){
45
- return this .activeComponentObj
46
- }
47
44
},
48
45
methods: {
49
46
getWindowHeight (e ) {
@@ -140,12 +137,12 @@ export default {
140
137
141
138
// add import mapstate and mapactions if they exist
142
139
let imports = ' '
143
- if (this .activeObj .actions .length || this .activeObj .state .length ){
140
+ if (this .activeComponentObj .actions .length || this .activeComponentObj .state .length ){
144
141
imports += ' import { '
145
- if (this .activeObj .actions .length && this .activeObj .state .length ) {
142
+ if (this .activeComponentObj .actions .length && this .activeComponentObj .state .length ) {
146
143
imports += ' mapState, mapActions'
147
144
}
148
- else if (this .activeObj .state .length ) imports += ' mapState'
145
+ else if (this .activeComponentObj .state .length ) imports += ' mapState'
149
146
else imports += ' mapActions'
150
147
imports += ' } from "vuex"\n '
151
148
}
@@ -163,9 +160,9 @@ export default {
163
160
164
161
// if true add data section and populate with props
165
162
let data = ' '
166
- if (this .activeObj .props .length ){
163
+ if (this .activeComponentObj .props .length ){
167
164
data += ' data () {\n return {'
168
- this .activeObj .props .forEach (prop => {
165
+ this .activeComponentObj .props .forEach (prop => {
169
166
data += ` \n ${ prop} : "PLACEHOLDER FOR VALUE",`
170
167
})
171
168
data += ' \n '
@@ -175,10 +172,10 @@ export default {
175
172
176
173
// if true add computed section and populate with state
177
174
let computed = ' '
178
- if (this .activeObj .state .length ){
175
+ if (this .activeComponentObj .state .length ){
179
176
computed += ' computed: {'
180
177
computed += ' \n ...mapState(['
181
- this .activeObj .state .forEach ((state ) => {
178
+ this .activeComponentObj .state .forEach ((state ) => {
182
179
computed += ` \n "${ state} ",`
183
180
})
184
181
computed += ' \n ]),\n '
@@ -187,10 +184,10 @@ export default {
187
184
188
185
// if true add methods section and populate with actions
189
186
let methods = ' '
190
- if (this .activeObj .actions .length ){
187
+ if (this .activeComponentObj .actions .length ){
191
188
methods += ' methods: {'
192
189
methods += ' \n ...mapActions(['
193
- this .activeObj .actions .forEach ((action ) => {
190
+ this .activeComponentObj .actions .forEach ((action ) => {
194
191
methods += ` \n "${ action} ",`
195
192
})
196
193
methods += ' \n ]),\n '
0 commit comments