Reputation: 1043
I have about 20 forms which get switched using a dynamic component
<component v-bind:is="activeForm"></component
Rather than have about 20 of these
import Concentform from '../forms/concentForm'
and 20 declarations
export default {
components: {
Concentform,
anotherForm,
moreForms,
}
}
Can I do a mass import?
Upvotes: 0
Views: 515
Reputation: 2070
Add index.js
under ../forms
with
import Concentform from './concentForm'
export default {
Concentform
}
Import all in once (default) import forms from '../forms/'
export default {
components: {
...forms,
otherComponent
}
}
Upvotes: 3