Skip to content

A better way to display select boxes when using `v-for` on objects.

License

Notifications You must be signed in to change notification settings

alvaroenoht/vue-dropdowns

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

vue-dropdowns

A better way to handle v-for on objects.

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

Demo

Requirements

Installation

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

Usage

<dropdown :options="arrayOfObjects" 
          :selected="object" 
          v-on:updateOption="methodToRunOnSelect" 
          :placeholder="'Select an Item'">
</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>

License

The MIT License

About

A better way to display select boxes when using `v-for` on objects.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vue 100.0%