Is it possible to inherit/extend a core field?
See original GitHub issueHello,
my question is if it’s possible to inherit(using extends) for example the fieldSelect
just to include something in its templatе?
I don’t want to just copy the whole field code and modify it for my needs and use it as a custom field. I think it would be possible if we could import the fieldsComponents
themselves. Right now in my opinion only the abstractField
mixin is exposed and used when defining custom fields, but that is not my case.
My problem with copying the fieldSelect
and using it as custom field is that when at some point a newer version of vue-form-generator
fixes something or improves the component, my copy of it has to be maintained by me and manually updated to incorporate the fixes or improvements.
Any thoughts on this @icebob?
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (8 by maintainers)
Maybe simpler alternatives such as adding component names exporting fields in a separate file //input field
//fields index file
Usage:
To me this seems more usable and controllable (in terms of size because webpack does tree-shaking if you do partial imports) rather than installing a new field with npm. Npm packages as fields might be a good idea for direct script includes if you don’t need the whole vfg
@Vacilando If you’re using pug you can actually do that via
Vue.extends
and extend templates http://vuejsdevelopers.com/2017/06/11/vue-js-extending-components/ If not you can extend the component only and copy the template part from the original vfgField and modify it how you want