This component is a form with validation and more using only javascript objects
yarn add ic-formly
npm i --save ic-formly
npm run serve
import IcFormly from 'ic-formly';
Vue.use(IcFormly);
let duckModel = {
duck: {
name: 'Charlie',
specie: 'Mountain Duck'
}
};
let duckFields = [
{
key: 'duck.name',
type: 'input',
required: true
}, {
key: 'duck.specie',
type: 'input',
required: true
}
];
<div>
<pre><code>{{JSON.stringify(duckModel)}}</code></pre>
<ic-formly
ref="formly"
v-model="duckModel"
:fields="duckFields"/>
<button @click="$refs.formly.submit()">
Submit
</button>
</div>
<script src="https://unpkg.com/vue" charset="utf-8"></script>
<script src="./umd/ic-formly.min.js" charset="utf-8"></script>
Build configuration is located in the poi.config.js
file, to build just run: npm run build
, it will build to dist
directory.
This template uses karma with chai by default, you can change test settings in poi.config.js
npm run test
npm run test:watch
npm run test:cov
This project is licensed under Apache 2