1.0.3 • Published 6 years ago

vue-g-components v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

vue-g-components

A Google style Vue components

Input

<g-input v-model="ValidationExample" placeholder="Username" pattern="^[a-zA-Z0-9]{4,10}$" validation-message="No Special characters allow!"></g-input>

Checkbox

<g-checkbox v-model="checkboxExample" value="Milk" required validation-message="Milk is required!">Milk</g-checkbox>

Install

yarn

yarn add vue-g-components

npm

npm install vue-g-components --save

Setup

Register the plugin.

import GComponents from 'vue-g-components';

Vue.use(GComponents);

Or register components manually.

import {GInput,GCheckbox} from 'vue-g-components';

Vue.component('g-input', GInput);
Vue.component('g-checkbox', GCheckbox);

Params

Input

ParameterTypeDefault
idstringinput-id-(element uid)
class-namestringnull
namestringnull
v-modelstring, numbernull
valuestring or numbernull
typetext, password, date, number, datetime-local,month, search, tel, time,url or week,text
placeholderstringnull
patternstringnull
validation-messagestringnull
requiredbooleanfalse
disabledbooleanfalse
minnumbernull
maxnumbernull
stepnumbernull

Checkbox

ParameterTypeDefault
idstringcheckbox-id-(element uid)
class-namestringnull
namestringnull
v-modelstring, boolean or arrayundefined
valuestring or booleannull
checkedbooleanfalse
requiredbooleanfalse
disabledbooleanfalse
validation-messagestringnull

Events

Both components emit the input event to work with v-model and change.

License

MIT © Toshal Infotech