🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

vue-dropdowns

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-dropdowns

An easier way to display select boxes using objects

1.1.2
latest
Source
npm
Version published
Weekly downloads
855
104.06%
Maintainers
1
Weekly downloads
 
Created
Source

vue-dropdowns

A better way to handle v-for on objects.

No special dependencies, no jquery, no bootstrap, just VueJS and CSS goodness.

Demo

  • Demo - https://mikerodham.github.io/vue-dropdowns/

Requirements

Installation

$ npm install vue-dropdowns
// OR
$ yarn add vue-dropdowns

Usage

<dropdown class="my-dropdown-toggle"
          :options="arrayOfObjects" 
          :selected="object" 
          v-on:updateOption="methodToRunOnSelect" 
          :placeholder="'Select an Item'"
          :closeOnOutsideClick="boolean">
</dropdown>

<script>
import dropdown from 'vue-dropdowns';

export default {
        data() {
          return {
            arrayOfObjects: [],
            object: {
              name: 'Object Name',
            }
          }
        },

        components: {
            'dropdown': dropdown,
        },

        methods: {
          methodToRunOnSelect(payload) {
            this.object = payload;
          }
        }
      }
</script>

<style scoped>
.my-dropdown-toggle {
  border-radius: 5px;

  ::v-deep .dropdown-toggle {
    color: tomato;
    font-size: 25px;
    font-weight: 800;
  }

  ::v-deep .dropdown-toggle-placeholder {
    color: #c4c4c4;
  }
}
</style>

Default values of props

PropertyTypeDefault value
closeOnOutsideClickbooleantrue
placeholderstring'Select an Item'

License

The MIT License

Keywords

vue

FAQs

Package last updated on 15 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts