Code Monkey home page Code Monkey logo

vue-dynamic-select's Introduction

vue-dynamic-select

A VueJS plugin that provides a searchable and reactive select list component with no dependencies.

alt text

View Online Demos Here

Installation

npm install vue-dynamic-select --save

Import

import DynamicSelect from 'vue-dynamic-select'

Vue.use(DynamicSelect)

Usage

// Static options source (array)
<dynamic-select 
    :options="objectArray"
    option-value="id"
    option-text="name"
    placeholder="type to search"
    v-model="selectedObject" />

// Dynamic options source (ajax, etc)
<dynamic-select 
    :options="objectArray"
    @search="onSearchEventHandler"
    option-value="id"
    option-text="name"
    placeholder="type to search"
    v-model="selectedObject" />

NOTE: For more detailed usage see the examples folder.

Properties

Name Type Default Description
options Array [ ] Array of objects that will create the select list options
option-value String id The object property used for the value of the select options
option-text String name The object property used for the display text of the select options
v-model Object null Object containing the the selected object
placeholder String search String containing the text to be used as a placeholder

Events

Name Description
search Triggered whenever search text changes. Value is the current search string.
input Triggered whenever an option is selected.

vue-dynamic-select's People

Contributors

cbertelegni avatar josef-friedrich avatar silasmontgomery avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vue-dynamic-select's Issues

Pre Define selection

how do you pre define selected option by id?

When you bring data from server.

Result-list scrool

Hi!
Is there way to set result-list scrool ?
If I have 100 options in result list it open all, and that make page height to long.

When I pass a getter as value prop, and when the getter changes to null, the dynamic-select doesn't reset.

When I pass a getter as value prop, and when the getter changes to null, the dynamic-select doesn't reset.

<dynamic-select
          :options="optsList"
          :value="selectedOpt"
          option-value="id"
          option-text="name"
          placeholder="Elegí una opción"
          />
computed: {
    selectedOpt () {
      if (this.context.distrito) {
        return {
          id: this.context.distrito, // vuex getter
          name: this.distritoName // vuex getter
        }
      }
      return null
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.