1.0.9 • Published 5 years ago

@venoid/admin-form v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Venoid Admin Form Component

npm npm bundle size (scoped)

Form component for your administration provides you good options how to build your form.

screenshot-example

Props

PropsTypeDefault
actionsArray[]Array of objects with options. Represent buttons in the bottom of the form.
fieldsObject{}Keys of this object correspond to properties of your data model. Options here
isLoadingBooleanfalseShows loading animation on the form.
modelObject{}Your data model.

action options

{
  label: 'Say hello' // String,
  onclick: () => { window.alert("Hello") }, // Function - your validator function
  type: 'default' // Enum['is-primary', 'is-danger', 'is-secondary', 'default']
}

field options

{
  icon: 'pencil', // String - name of material design icon
  label: 'Author', // String
  options: ['orange', 'apple'], // Array, used for select field type
  placeholder: 'Enter author name', // String
  type: 'text', // Enum['text','number','password','email','checkbox','select','switch']
  validator: (value) => { // Function - your validator function
    if (value.length < 4) {
      throw new Error('Value must have at least 4 chars.')
    }
  }
}

Demo

To see demo run a project:

  1. Install npm dependencies
  2. Run with npm run serve / yarn serve
1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

1.0.2

5 years ago