0.2.3 • Published 4 years ago

vue-form-send v0.2.3

Weekly downloads
7
License
MIT
Repository
github
Last release
4 years ago

Vue Form Send

A Vue.js directive for sending data from form and primitive validation inputs

Installation

npm i --save-dev vue-form-send
import VueFormSend from 'vue-form-send'

Vue.use(VueFormSend)

SSR (Nuxt.js)

import VueFormSend from 'vue-form-send/dist/ssr.index'

Vue.use(VueFormSend)

Usage

<form v-form-send='{success: successResult, fail: failResult}' class='form' action='./send.php' method='post'>
  <input v-form-input='{length: 5}' name='phone' type='text' placeholder='Length > 5'/>
  <input v-form-input='{length: 5, replace: ["-", "/"]}' name='phone' type='text' placeholder='Length > 5 and replace'/>
  <input v-form-input='{length: 5, clean: true}' name='phone' type='text' placeholder='Length > 5 and clear'/>
  <input v-form-input='{length: 5, timeoutError: 0, changeValidation: true}' name='phone' type='text' placeholder='Length > 5 and timeoutErorr 0'/>
  <input v-form-input='{length: 5, changeValidation: true}' name='phone' type='text' placeholder='Length > 5 and changeValidation'/>
  <input v-form-input='{type: "checked"}' name='phone' type='checkbox'/> 
  <button>Send</button>
</form>

Directive options

Form

OptionValue typeDescription
pressButtonFunctionCall function after click to form button
successFunctionCall function after success send data
failFunctionCall function is fail validation or send data
credentialsBooleanUse credentials
authFunction -> {type: String, data: String}User auth. Return object with auth type and data string format username:password

Element

OptionValue typeDescription
lengthIntegerCheck length value of element
replaceBooleanReplacing symbols from text value
clearBooleanClear value after success send data
timeoutErrorIntegerTimeout for remove error class
changeValidationBooleanReal-time validaton if change input value
typeStringTypes of verification (length of checked). Default - length.
0.2.3

4 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago