1.2.5 • Published 1 year ago

lb-vue-select v1.2.5

Weekly downloads
21
License
GNU
Repository
gitlab
Last release
1 year ago

Screenshot

Description

Install

npm install lb-vue-select --save

Include plugin in your main.js file.

import Vue from 'vue'
import lbVueSelect from 'lb-vue-select';
Vue.component('lb-vue-select', lbVueSelect);

Using

template code

<template>
    <lb-vue-select v-model="value" :list="list" :pagination="pagination" display-field="value" value-field="key" multiselect="true" empty="true" search-placeholder="Search" items-placeholder="Items per page"></lb-vue-select>
</template>

script code

export default {
    data(){
        return {
            value: '1',
            //value: '1,2' - in case of multiselect
            totalCount: 300, //optional
            list: [
                {
                    key: '1',
                    value: 'First option'
                },
                {
                    key: '2',
                    value: 'Second option'
                }
            ],
            pagination: {
                query: '',
                currentPage: 1,
                limit: 20,
                initialId: [],
                searchTimeout: false
            }
        }
    },
    watch:
    {
        'pagination.query'(query)
        {
            //when someone queries, do the store reload here
        },
        'pagination.currentPage'(page)
        {
            //when someone changes the page, do the store reload here
        }
    }
};

Available settings

PropertyTypeRequiredDescription
value (v-model)string*Value string, in case of multiselect, separated by comma ','
listObject*Array of objects containing values
display-fieldstringDisplay field key form list item object (Defaults to key)
display-funcfunctionIf you want to combine multiple fields to display text, you can specify custom function which receives one argument (item)
value-fieldstringValue field key form list item object (Defaults to value)
multiselectbooleanIf you want to enable multiselect (Defaults to false)
select-allstringText that will be placed next to checkbox for selecting all options. Available only along with :multiselect="true". If not provided, checkbox will not be available
all-selected-textstringText that will be displayed in input instead of all checked options when there are more then 5 selected options.
searchBoxbooleansearchBox will appear if set to true.
emptybooleanIf you want to enable deselection of value (Defaults to false)
paginationobjectIn case you use pagination, object as in example
totalCountintIn case you use pagination in select, total count of all items
searchPlaceholderstringPlaceholder for pagination search, if using vue-i18n it will use key 'SEARCH', if omited will use "Search"
itemsPlaceholderstringPlaceholder for pagination items per page selector, if using vue-i18n it will use key 'ITEMSPERPAGE', if omited, will use "Items per page"
cssstringClass to use on input (Defaults to form-control)
disabledbooleanDisables input if set to true (Defaults to false)

Available events

EventArgumentsDescription
click-
changevalueNew value

1.2.5

1 year ago

1.2.3

4 years ago

1.2.0

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

5 years ago

1.1.1

5 years ago

1.1.4

5 years ago

1.1.0

5 years ago

1.0.32

6 years ago

1.0.31

6 years ago

1.0.30

6 years ago

1.0.29

6 years ago

1.0.28

6 years ago

1.0.27

6 years ago

1.0.26

6 years ago

1.0.25

6 years ago

1.0.24

6 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago