1.0.0 • Published 3 years ago

@shapla/vue-input v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Shapla TextField

A simple customized input text field.

Table of contents

Installation

npm install --save @shapla/vue-input

Usage

Styles

with Sass:

import '@shapla/vue-input/src/index.scss';

with CSS:

import '@shapla/vue-input/dist/style.css';

Javascript Instantiation

import ShaplaInput from '@shapla/vue-input';

export default {
  name: 'Hello',

  components: {
    ShaplaInput
  }
}
<shapla-input
  label="Email"
  help-text="Write your valid email address"
  validation-text="Please enter a valid email address"
  :has-error="true"
/>

Props

PropertyTypeRequiredDefaultDescription
typeStringnotextInput field type. Supports all types that support for normal input field
labelStringyes | Input field label
modelValueStringno | Field value
autocompleteStringno | Field autocomplete attribute
nameStringno | Field name attribute
idStringno | Field id attribute
helpTextStringno | Field help text
validationTextStringno | Field validation text
hasErrorBooleannofalseIf set true, field will show validationText
hasSuccessBooleannofalseIf set true, field will show success status
disabledBooleannofalseIf set true, field will be read only
requiredBooleannofalseIf set true, field must be filled
readonlyBooleannofalseIf set true, User cannot modify field value but data can be submit
rowsNumberno | Set number of rows for textarea field
dirStringnoltrSet direction. Value can be ltr or rtl or auto

Listeners

The input component fires the following events:

update:modelValue: When you input anything on field

<!-- template -->
<text-field @update:modelValue="handleInputEvent"/>


<!-- method -->
methods: {
handleInputEvent(value){
// Handle input event
}
}