1.0.0 • Published 3 years ago

@shapla/vue-slider v1.0.0

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

Shapla Range Slider

A simple component for input slider for Vue 3

Table of contents

Installation

npm install --save @shapla/vue-slider

Usage

Add the component:

import ShaplaRangeSlider from '@shapla/vue-slider';

export default {
  name: 'Hello',
	data(){
		return {
			number: 10,
		}
	},
	components: {
    ShaplaRangeSlider
	},
}
<shapla-range-slider v-model="number" :default="20"/>

Props for columns

PropertyTypeRequiredDefaultDescription
modelValueNumbernonullValue of the input
defaultNumberno0The default value of the input
minNumberno0Min value of input
maxNumberno100Maximum value of input
stepNumberno1Step of input slider
showResetBooleannotrueSet true to show reset to default value
showInputBooleannotrueSet true to show input field to change value

Listeners

The input slider component fires the following events:

update:modelValue: When value is changed, it fires the event.

<!-- template -->
<input-slider :value="20" :default="10" @update:modelValue="handleInput"></input-slider>


<!-- method -->
methods: {
  handleInput(newValue){
    // Handle input event
  }
}