1.1.0 • Published 3 years ago

vue-scroll-picker-sylvainlafayen v1.1.0

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

Vue Scroll Picker

iOS Style Scroll Picker Component for Vue 3. Support All Gestures of Mouse(also MouseWheel) and Touch.

If you are using vue 2, please refer to the v0.x branch.

See Example (sources)

Installation

npm i vue-scroll-picker

Usage

Global Registration

Vue3 Global Registration Guide

import { createApp } from 'vue'
import VueScrollPicker from 'vue-scroll-picker'

import 'vue-scroll-picker/lib/style.css'


const app = createApp(/* */)

app.use(VueScrollPicker) // export default is plugin

Local Registration

Vue3 Local Registration Guide

<template>
  <VueScrollPicker :options="options" />
</template>
<script>
import { VueScrollPicker } from 'vue-scroll-picker'

export default {
  components: {
    VueScrollPicker, // export VueScrollPicker is component
  },
}
</script>
<style src="vue-scroll-picker/lib/style.css"></style>

Options

Props

NameTypeDefaultExample
modelValueanynull
placeholderstringnull
emptystring'No Items'
optionsstring[]{ name: string, value: any }[][]["10KG", "20KG", "30KG"][{value: 10, name: "10KG"}, {value: 20, name: "20KG"}]
dragSensitivitynumber1.7
touchSensitivitynumber1.7
scrollSensitivitynumber1

Events

NameType
update:modelValueany

Slots

NamePropDefault
default{ option: { name: string, value: any } }{{ option.name }}
placeholder{ text: string }{{ placeholder }}
empty{ text: string }No Items