-
Notifications
You must be signed in to change notification settings - Fork 533
Fix fields exposition (temporary solution) #476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix fields exposition (temporary solution) #476
Conversation
src/formGenerator.vue
Outdated
fieldComponents[compName] = Fields(key).default; | ||
}); | ||
} | ||
|
||
export default { | ||
name: "formGenerator", | ||
components: { formGroup }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're not actually exposing them in the FormGenerator.components property. Shouldn't components: { formGroup }
be components: { fieldComponents }
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes sorry !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this break a lot of things :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zoul0813 I tried an alternative way to provide the same functionality.
It export fieldComponents
, so you should be able to do that :
import { fieldComponents as VueFormGenerator } from 'vue-form-generator';
/* ... */
mixins: [ VueFormGenerator['fieldInput'] ],
or either
import { fieldComponents as coreFields} from 'vue-form-generator';
/* ... */
mixins: [ coreFields['fieldInput'] ],
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"I" don't need this fix ... but if anyone did the same thing :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should work, have you tried it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haven't checked it, no ... but it looks like it will work just fine.
Should formGroup import the fieldComponents from index ... rather than repeating the same logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have refactored the code, they share a module which load the components
Fix the fact that, fields are not exposed
You cannot import fields like that
VueFormGenerator.components['fieldInput']
You should be able to do it like before