Created
June 20, 2019 15:49
-
-
Save travist/c7b5ea52bb246631bd767acb5b31faf7 to your computer and use it in GitHub Desktop.
Override Validation Components
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import BaseEditValidationForm from 'formiojs/components/base/editForm/Base.edit.validation.form'; | |
import _ from 'lodash'; | |
const customValidation = _.cloneDeep(BaseEditValidationForm[4]); | |
customValidation.components.splice(3, 1); | |
Formio.builder(document.getElementById('builder'), {}, { | |
editForm: { | |
textfield: [ | |
{ | |
key: 'validation', | |
components: [ | |
{ | |
key: 'custom-validation-js', | |
components: customValidation.components | |
} | |
] | |
} | |
] | |
} | |
}).then(function(builder) { | |
builder.on('saveComponent', function() { | |
console.log(builder.schema); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment