Creating Formly Fields

Before you jump into creating your own formly fields, note that there's a Formly Bootstrap project underway which will eventually have a full bootstrap setup. If you still want to make your own then carry on. It'd be a good idea to have a read through the source code for that project to see how you can bundle everything together nicely. But anyway...

Vue Formly provides a method addType which allows you to add a new field. It takes an ID and an object which should be an extended vue instance. eg:

let myNewField = Vue.extend({
  props: ['form', 'key'],
  template: '<input type="text" v-model="form[key].value">'
});

Vue.$formly.addType('text', myNewField);

results matching ""

    No results matching ""