0.1.9 • Published 6 years ago

vue-coe-select v0.1.9

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

Install

yarn add vue-coe-select

Examples

<template>
  <div class="container">
    <c-select
      display="slug"
      display-by="name"
      placeholder="Selecione uma opção"
      clear-on-select
      :items="items"
      v-model="data1"
    >
      <div slot="option" slot-scope="{ option }">
        {{ option['slug'] }} - {{ option['name'] }}
      </div>
    </c-select>

    <c-select
      display="slug"
      display-by="name"
      placeholder="Selecione uma opção"
      multiple
      hide-selected
      :items="items"
      v-model="data2"
    />

    <c-select
      display="slug"
      display-by="name"
      placeholder="Selecione uma opção"
      :validation="data3.length >= 3 && `Máximo de 3 opções selecionadas`"
      multiple
      :items="items"
      v-model="data3"
    />
  </div>
</template>

<script>
import CSelect from 'vue-coe-select'

export default {
  name: 'teste',

  components: { CSelect },

  data () {
    return {
      data1: '',
      data2: [
        { slug: 'slug_boladao2', name: 'coe2' }
      ],
      data3: [],
      items: [
        { slug: 'slug_boladao1', name: 'coe1' },
        { slug: 'slug_boladao2', name: 'coe2' },
        { slug: 'slug_boladao3', name: 'coe3' },
        { slug: 'slug_boladao4', name: 'coe4' },
        { slug: 'slug_boladao5', name: 'coe5' },
        { slug: 'slug_boladao6', name: 'coe6' }
      ]
    }
  }
}
</script>

Props

NametyperequiredAbout
itemsArraytrueoptions to display
valueAnytruesome pre-set value
placeholderStringfalse-
optionSelectPlaceholderStringfalse-
optionUnselectPlaceholderStringfalse-
labelStringfalsetitle/label of input
requiredBooleanfalseadd a * indicating that the field is required
validationString, Booleanfalseconditional that returns a boolean
displayStringfalse-
displayByStringfalse-
multipleBooleanfalse-
hideSelectedBooleanfalse-
clearOnSelectBooleanfalse-
disabledBooleanfalse-

slot-scope

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.1.5

6 years ago