Closed Sefux closed 4 years ago
never mind, i found a way to include the control/config.
in the registration options i switched from using "require" to an "import" statement. Now it work's.
Hi @eliveltonrangell ,
not quit sure what is not working for you, but to be more specific...
in your main.js|ts file you include something like this:
Vue.use(VueFormBuilderPlugin, {
controls: {
'switch': {
name: "Switch Field",
description: "Single Switch",
/**
* Control View Mapping
*/
fieldComponent: require('./custom-controls/switch/SwitchControl'),
...
The last line is where the require-statement should be changed to an import-statment:
import SwitchControl from './custom-controls/switch/SwitchControl'
Vue.use(VueFormBuilderPlugin, {
controls: {
'switch': {
name: "Switch Field",
description: "Single Switch",
/**
* Control View Mapping
*/
fieldComponent: SwitchControl ,
...
You have to do the same for the configComponent.
hope it helps you... probalby you write here if that is the case, then documentation should be updated.
Hi @sethsandaru,
great project, thanks for creating it. I am using V2.0.1
I am having problems adding custom controls. I tried to follow your instructions from here. I can see my new control in the sidebar, but when i click to add i am getting this error:
Failed to mount component: template or render function not defined.
found in
Anonymous ControlView Draggable NormalSectionView SectionContainer FormBuilder ...
Do you have any advice on how to handle this? I can set up a test repository if you can not reproduce the error..
Thanks in advance