vue-symfony-form

A Vue.js plugin for Symfony ajax form creation
1,902 4
Install
npm install vue-symfony-form
Latest Version:1.2.2
Vue:2
License:MIT
Last Updated:Apr 4, 2019
Links: GitHub  ·  npm
Maintainer: 22116

vue-symfony-form

Easy to use AJAX forms written to handle symfony form errors.

Set Up

Enable symfony-form plugin and add connector:

import symfonyForm from 'vue-symfony-form';
import connector from 'vue-symfony-form/src/core/connector';

Vue.use(symfonyForm, {
  connector: connector
});

Connector is a driver responsible for sending messages. You can replace it with your own.

Usage

Create new form with symfony-form component with required action attribute.
Following code will send simple GET request to action url:

<symfony-form action="/foo">
  <input type="text" name="name" />
  <input type="email" name="email" />
  <button>Send</button>
</symfony-form>

When form will be proceeded you'll get appropriate errors above fields in case your form data isn't valid.

That's all.

Hooks

@beforeSubmit(data)
Action procceeded before data will be sent.
@onSuccess(request)
Action in case of success status
@onFail
Action in case of invalid data
@onSubmit
Action procceeded when request completely sent

Properties

:method
Request method ('GET' by default)
:error-class
Class which will be performed to error divs
:data-prefix
Set unify data prefix for input fields. [dataPrefix][name]
:is-secure
Just a flag to use in connector. You can modify connector and set extra headers for authorized requests

Slots

warning
Use it to modify default error message in case of request was failed

Look usage examples in examples directory

Related Packages

@xuanmo/v-form

* 目前已经集成的组件(Address/Checkbox/DatePicker/Input/Radio/Select/Text/Switch...

8,127 86
@ezijing/vue-form

基于Vue Element-UI的表单

3,486
@vigilio/vue-form

Now you can use this vue form library

1,009 2
jenesius-vue-form

Heavy form system for Vue.js

4,940 45
vue-trans

A filter to provide similar use of translations as with Symfony | trans

16,113 14

Version History

Version Released Vue License
1.2.2 ^2.5.16 MIT
1.2.1 ^2.5.16 MIT
1.2.0 ^2.5.16 MIT
1.0.5 ^2.5.16 MIT
1.0.4 ^2.5.16 MIT
Pre-releases (4)
Version Released Vue License
1.1.2-beta ^2.5.16 MIT
1.1.0-beta ^2.5.16 MIT
1.0.7-beta ^2.5.16 MIT
1.0.5-beta ^2.5.16 MIT