1.0.0 • Published 3 years ago
vue-fieldsafe v1.0.0
@ Vue FieldSafe
Just an abstraction of the FieldSafe package for Vue.js
Library to assist in the development of security for form fields, with validation by RegEx, Sanitization and Mask in inputs.
Installation
npm:
$ npm install vue-fieldsafeyarn:
$ yarn add vue-fieldsafeUsage:
<template>
<main>
<h1>Vue FieldSafe</h1>
<form method="post" @submit.prevent="myform">
<input
type="text"
name="email"
placeholder="Email"
v-model="email"
/>
<button type="submit">Submit</button>
</form>
</main>
</template>
<script>
import { Validation } from 'vue-fieldsafe';
export default {
data() {
return {
email: 'guest@mail.com'
}
},
methods: {
myform() {
const validator = new Validation();
const isEmail = validator.email(this.email);
console.log(isEmail); // true
}
}
}
</script>1.0.0
3 years ago