vue-selector-multioption

0.2.1 • Public • Published

vue-selector-multioption

npm npm

Index

Description

This is a fast-implement vue multioption select.

Advices, recommendations... are welcome ❤️

Live Demo

https://jsfiddle.net/Ln9q4aob/55/

TODO List

  • [ ] Create a external page with explanations and demos

Usage

There are two ways of usage

Global Scoped

  1. Add your import on top of your main.js and add as a Vue plugin
import Vue from 'vue';
import  VueSelectorMultioption  from  'vue-selector-multioption';
Vue.use(VueSelectorMultioption);
  1. Use it wherever you want
<vue-selector-multioption :options="options.roles"  v-model="parameters.roles" />

Local scoped (DO NOT ACCEPT PARAMETERIZATION)

  1. Add your import on top of you vue file.
import  VueSelectorMultioption  from  'vue-selector-multioption';
  1. Add as a component into you Vue view/component.
components: {
	VueSelectorMultioption
}
  1. Add the component's tag into your template.
<VueSelectorMultioption :options="options.roles"  v-model="parameters.roles" />

Global parameterization

  • i18n: Labels customization
    • noOptionsSelected
    • noResultsFound
    • inputPlaceholder

    Example

        import VueSelectorMultioption from 'vue-selector-multioption'
        Vue.use(VueSelectorMultioption, {
            i18n: {
                noOptionsSelected: "No se encontraron resultados",
                noResultsFound: "Selecciona una opcion",
                inputPlaceholder: "¿Qué buscas?"
            }
        })

Shortcuts

Note: Shortcuts only work with the options list opened

Key Action
Arrow - Down Navigates downward between options
Arrow - Up Navigates upward between options
Enter Select the focused option when navigating
ESC Close the options list

Properties

  • options This is a Object with attributes "label" and "value" whose will be displayed on the dropdown.
  • v-model If you work with vue, you know that. Set there the parameter where the component will emit the value.

Return

Array of selected values. Values will be those given in the "options" parameter.

Package Sidebar

Install

npm i vue-selector-multioption

Weekly Downloads

0

Version

0.2.1

License

MIT

Unpacked Size

196 kB

Total Files

16

Last publish

Collaborators

  • sawonersm