A Vue Select Component By Pumelo
中文文档请看README-Zh.md
https://pumelotea.github.io/pumelo-select-preview/
- pure data-drive component
- support vue instruction: v-model
- support data two-way binding
- support change event
- support disabled attribute
- provide search entry
- support data group
import component by your choose,there are two components
import SelectX from '@/components/Select'
import GroupSelectX from '@/components/GroupSelect'
register it in vue instance like
components: {
SelectX,GroupSelectX
}
create data struct in vue instance,there are some diff in Select and GroupSelect
Select data struct
[{value:'1',text:"Some Text"}]
GroupSelect data struct
[{group:'groupName',data:[{value:'1',text:"Some Text"}]}]
use it in template code like
<select-x :data="list" v-model="selectedVal"></select-x>
<group-select-x :data="list1" v-model="selectedVal1"></group-select-x>
the change event is easy,you should define a function like
onChange:function (data) {
console.log(data)
}
then bind on @change or v-on:change
use :disable="true" ,disabled default value is false
the search input provide @on-search event,you can bind your function like
searchCallback:function(data){
console.log(data)
this.searchKey=data
}
<select-x :data="list" v-model="selectedVal" @on-search="searchCallback"></select-x>
you should implement what logic you want. it's open.
you can change style if you think this style not ok, edit the component by your self directly.
maybe the component have some bugs,if have can you send me a email(535553297#qq.com,replace '#' to '@') as soon as ?
thanks for your support.