dropup2

0.1.5 • Public • Published

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>

Readme

Keywords

none

Package Sidebar

Install

npm i dropup2

Weekly Downloads

1

Version

0.1.5

License

none

Unpacked Size

16.3 kB

Total Files

10

Last publish

Collaborators

  • nachmanrosen