1.0.5 • Published 3 years ago

sp-dropdown v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

sp-dropdown

Description

It is a simple dropdown builder for vue js

Installation

npm i sp-dropdown

Usage

<template>
  <div class="container">
    <sp-dropdown
      :title=title
      :list=list
    />
  </div>
</template>
<script>
import SpDropdown from 'sp-dropdown';
export default {
  data() {
    return {
      title: 'Select Auto',
      list: [
        {
          value: 1313123,
          title: 'Mercedes'
        },
        {
          value: 2424242,
          title: 'Audi'
        },
        {
          value: 3445465,
          title: 'Seat'
        },
        {
          value: 6756454,
          title: 'Suzuki'
        }
      ]
    }
  },
  components: {
    SpDropdown
  }
}
</script>

Get Selected Value

You can get the value of the selected item with "onSelected custom event"

<sp-dropdown
  :title=title
  :list=list
  @onSelected="getSelected"
/>
methods: {
    getSelected(selectedItem) {
      console.log(this.selectedItem);
    }
  }
1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.1

3 years ago