1.0.0 • Published 6 years ago

meta-textarea v1.0.0

Weekly downloads
2
License
ISC
Repository
gitlab
Last release
6 years ago

meta-textarea

pipeline status coverage report

Component type text area to be used within forms. It contains all required validations.

Installation

npm install --save meta-textarea

You also have to inject a validator instance into your Vue application:

src/main.js

import VeeValidate, { Validator } from 'vee-validate'

# Optional language package
import ptBR from 'vee-validate/dist/locale/pt_BR' 
Validator.addLocale(ptBR) # Optional

Vue.use(VeeValidate, {
  inject: false,
  locale: 'pt_BR',
  fieldsBagName: 'validationFields',
})

Usage

Just import it and use it as a directive:

<template>
  <div id="app">
    <meta-textarea id="id" name="name" label="Any Text" v-model="textarea"></meta-textarea>
  </div>
</template>

<script>
import MetaTextarea from 'meta-textarea'

export default {
  name: 'App',
  components: {
    MetaTextarea,
  },
  data() {
    return {
      text: '',
    };
  }
}
</script>

Props

ParameterTypeRequiredDefaultDescription
classesobjectfalse{}
disabledbooleanfalsefalse
idstringtrue
labelstringtrue
maxlengthnumberfalse255
minlengthnumberfalse0
namestringtrue
patternstringfalse(.*)Regex to be applied
placeholderstringfalse
readonlybooleanfalsefalse
rowsstringfalse4Number of rows
colsstringfalse50Number of cols
requiredbooleanfalsefalse
validationsobjectfalse{}Validations applied by vee-validate

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

For detailed explanation on how things work, consult the docs for vue-loader.