leomax-vanilla-form
v0.0.14
Published
Обвязка над формами
Downloads
20
Readme
leomax-vanilla-form
Установка
npm i -S leomax-vanilla-form
Использование (don`t use that)
import Form from 'leomax-vanilla-form';
import 'leomax-vanilla-form/extends/order';
new Form({
extends: 'order',
element: '#my-form-id'
});
Интеграция
Добавление масок
import forms from 'lmx-front-component-forms';
import { connectByName } from 'leomax-vanilla-form/lib/Phone';
const myForm = forms.bind({
selector: '#my-form-id',
type: 'createOrder'
});
/*
<form>
...
<input name="myPhone" />
<input name="mySecondPhone" />
...
</form>
*/
connectByName(myForm, 'myPhone', 'mySecondPhone');