Skip to content

A Vuejs component to display Form validation errors

Notifications You must be signed in to change notification settings

ziadadeela/vue-form-error

Repository files navigation

vue-form-error

NPM Versionnpm-versionlicense

A simple Vuejs component that can be used to display form validation errors on inputs.

Demo

https://codesandbox.io/s/vue-form-error-kwjv0

Installation

npm install vue-form-error --save 

OR

yarn add vue-form-error

Usage

<template>
    <div>
        <FormError :errors="formErrors.name">
            <label for="Name">Name</label>
            <input type="text" class="form-control" id="Name"
                   placeholder="Name">
        </FormError>
    </div>
</template>

<script>
    // Import component
    import FormError from 'vue-form-error';
    // Import stylesheet
    import "vue-form-error/dist/FormError.css";
    
    export default {
        data() {
            return {
                formErrors:{}
            }
        },
        components: {
            FormError
        },
        methods: {
        }
    }
</script>

Run Examples Locally

  • Clone this repo
  • Install dependencies: npm install
  • Run dev server and it will open on http://localhost:8080 : npm run serve

License

Released under the MIT License.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy