1.3.1 • Published 4 years ago

@laomao800/vue-select-wrapper v1.3.1

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

vue-select-wrapper

A basic Vue.js Component that can wrap anything as a dropdown type selector.

vue-select-wrapper preview

Install

# yarn
yarn add @laomao800/vue-select-wrapper

# npm
npm install --save @laomao800/vue-select-wrapper

Documentation

中文 | English

Props

proptypedefaultdescription
value/v-modelanyundefinedBinding value. Should be an array when multiple:true
multiplebooleanfalsewhether use multiple-select
placeholderstring''placeholder
append-to-bodybooleantrueAppend the dropdown element to <body>
dropdown-widthnumber/stringundefinedWidth of the dropdown element. If not provided, the trigger element's width will be used.
dropdown-z-indexnumber1000Dropdown element z-index
disabledbooleanfalseDisable the component
sizestring''Component size. Could be medium/small/mini
clearablebooleanfalseWhether select can be cleared
limitnumberInfinityLimit the number of selected options displayed, must be greater than 0. The rest will be hidden within the limitText string.
limit-textfunctioncount => `+${count}`Function that processes the message shown when selected elements pass the defined limit.
popper-classstring''Custom class name for the dropdown
loadingbooleanfalseWhether the dropdown is display the loading status
loading-textstring'Loading'Text in the dropdown while loading
close-on-selectboolean-Close a dropdown when an option is chosen. default: single mode true , multiple mode false .

Slots

value-template

Custom content of the chosen values. Works in both single-select and multi-select modes.

<SelectWrapper v-model="selection">
  <template #value-template="{ value }">
    {{ value.valueProperty }}
  </template>
</SelectWrapper>

Methods

MethodsDescription
showDropdown()Show the dropdown
hideDropdown()Hide the dropdown
toggleDropdown()Toggle the dropdown
clearValue()Clear all value
updatePopper()Update dropdown position

Events

EventDescriptionParameters
changeTrigger on value change(newVal)
visible-changeTrigger on dropdown toggle(visible) true for show, false for hide
clearClick the clear icon or execute clearValue()-
1.3.1

4 years ago

1.3.0

4 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago