1.0.1 • Published 2 years ago

dropdown-vue-next v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

dropdown-vue

An easier way to display A Vue.js dropdown component, No special dependencies, no jquery, no tailwind.css, just VueJS and CSS magic.

Installation

$ npm install dropdown-vue-next
// OR
$ yarn add  dropdown-vue-next

Requirements

Usage

<Dropdown
  :options="arrayOfObjects"
  :selected="object"
  @updateOption="onSelectedOption"
  :placeholder="'Select your Option'"
  :closeOnOutsideClick="boolean"
>
</Dropdown>

<script setup>
  import Dropdown from 'dropdown-vue-next'
  import {reactive, ref} from 'vue
  const countries = ref([
      {id:1, name:'Morocco'},
      {id:2, name:'USA'},
      {id:3,name: "Canada"}
    ])
  let object = reactive({name: "Object Name"})

  const onSelectedOption = (payload) => object = payload
</script>

Default values of props

PropertyTypeDefault value
closeOnOutsideClickbooleantrue
placeholderstring'Select an option.'

License

The MIT License