dropdown-vue-next

1.0.1 • Public • Published

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

Property Type Default value
closeOnOutsideClick boolean true
placeholder string 'Select an option.'

License

The MIT License

Package Sidebar

Install

npm i dropdown-vue-next

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

7.65 kB

Total Files

7

Last publish

Collaborators

  • tal7aouy