# vue-ajax-form

> A Vue2 component for creating AJAX forms.

Latest version **0.3.2** (published 2018-11-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-ajax-form
pnpm add vue-ajax-form
yarn add vue-ajax-form
bun add vue-ajax-form
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2018-11-06 |
| First published | 2018-11-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 663.8 KB |
| Known vulnerabilities | 0 (+25 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | bono |

## Links

- npm: https://www.npmjs.com/package/vue-ajax-form
- npm.io page: https://npm.io/package/vue-ajax-form

## Dependencies (4)

- [vue](https://npm.io/package/vue.md) ^2.5.17
- [axios](https://npm.io/package/axios.md) ^0.18.0
- [vue-class-component](https://npm.io/package/vue-class-component.md) ^6.0.0
- [vue-property-decorator](https://npm.io/package/vue-property-decorator.md) ^7.0.0

## Recent versions

- 0.3.2 (latest) — 2018-11-06
- 0.3.1 — 2018-11-06
- 0.3.0 — 2018-11-06
- 0.2.1 — 2018-11-06
- 0.2.0 — 2018-11-06
- 0.1.0 — 2018-11-06

## README

# vue-ajax-form
A Vue2 component for creating AJAX forms.

## Installation

### via npm

```
npm install vue-ajax-form --save
```

### via yarn

```
yarn add vue-ajax-form
```

```ts
import AjaxForm from 'vue-ajax-form'

Vue.component('AjaxForm', AjaxForm)
```

### Or use a CDN
```html
<script src="https://unpkg.com/vue-ajax-form"></script>
```

## Usage

Use it like an HTML form.

```html
<ajax-form action="/users" method="post">
  <input type="email" name="email" placeholder="Email address">
  <input type="password" name="password" placeholder="Password">
  <button type="submit">Submit</button>
</ajax-form>
```

## Props

| Property | Type | Default | Description | Required? |
|----------|------|---------|-------------|-----------|
| axios | AxiosInstance | The static Axios instance | The axios instance to use for the requests. | No |
| action | string | # | The form action | No |
| method | string | POST | The form method | No |
| data | Object | {} | Additional data to merge into the request | No |

## Events

| Event | Description | $event |
|----------|------|---------|
| before | Emitted before the requests submits. | { axios, action, method, data } |
| success | Emitted after a 2xx response | Axios response object |
| error | Emitted after a 4xx response | Axios response object |
| complete | Emitted after the success or error event | |

---
_Source: https://npm.io/package/vue-ajax-form · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
