dropup2

A reusable Vue.js component for a dropup select menu. The component takes a prop: options: the options to pass into your dropup, each option must contain a name field. An option may contain also a description field, where you can add a description to yo

Usage no npm install needed!

<script type="module">
  import dropup2 from 'https://cdn.skypack.dev/dropup2';
</script>

README

A reusable Vue.js component for a dropup select menu. The component takes a prop: options: the options to pass into your dropup, each option must contain a name field. An option may contain also a description field, where you can add a description to your options. The dropup emits the selected data back up to its parent-DropUpContainer.vue

<div>
    <drop-up
            :options="myOptions"
            @select="select"
            @clear= "clear"
    ></drop-up>
</div>

<script>
    import DropUp from "./DropUp";
    export default {
        name: "DropUpContainer",
        data(){
            return{
                myOptions:[{name:'apples', description :'$2.00'}],
                selected: null
            }
        },
      methods: {
        select(user) {
          this.selected = user;
        },
        clear() {
          this.selected = {};
        },
      },
        components: {DropUp}
    }
</script>