1.2.1 • Published 5 years ago

meta-select v1.2.1

Weekly downloads
40
License
-
Repository
-
Last release
5 years ago

meta-select

pipeline status coverage report

Input component type boolean based on a checkbox to be used within forms. It contains all required validations.

Installation

npm install --save meta-select

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-select id="country" label="Country" name="country" v-model="country" attr-id="id" attr-label="name" :options="countries"></meta-select>
  </div>
</template>

<script>
import MetaSelect from 'meta-select'

export default {
  name: 'App',
  components: {
    MetaSelect,
  },
  data() {
    return {
      country: null,
      countries: [
          {id: 1, name: 'Argentina'},
          {id: 2, name: 'Brazil'},
      ],
    };
  }
}
</script>

Props

ParameterTypeRequiredDefaultDescription
attrIdstringfalseid
attrLabelstringfalselabel
classesobjectfalse{}
defaultstringfalse
disabledbooleanfalsefalse
idstringtrue
labelstringtrue
namestringtrue
optionsarraytrue
placeholderstringfalse
readonlybooleanfalsefalse
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.

1.2.1

5 years ago

1.2.0

5 years ago

1.0.7

5 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago