Vue Range Slider Component
Vue Range Slider Component (npm: `vue-range-component`) is a UI library providing a customizable range slider based on Vue.js 2.x. The current and only stable version is 1.0.3, last published over six years ago, indicating the project is no longer actively maintained. It offers features such as horizontal and vertical orientations, piecewise value display, configurable tooltips, and support for both single-value and range selection. It handles display of minimum and maximum values and is designed to be compatible with both PC and mobile touch interfaces. Given its reliance on Vue 2.x and lack of recent updates, it is not suitable for modern Vue 3 projects. It was built with Rollup and uses Stylus for styling, shipping with pre-compiled CSS.
Common errors
-
The slider cannot be used, because the component can not initialize the size or slider position.
cause The component was initialized while hidden (e.g., using `v-show="false"` or `display: none`) or its layout changed unexpectedly after initialization without being refreshed.fixEnsure the component is rendered with `v-if` when visible, use the component's `show` prop, or manually call the `refresh` method on the component instance (`this.$refs.slider.refresh()`) once the component becomes visible or its dimensions stabilize. -
[Vue warn]: Unknown custom element: <vue-range-slider> - did you register the component correctly?
cause The `VueRangeSlider` component was not properly registered with Vue before being used in the template of a parent component or application.fixEnsure `import VueRangeSlider from 'vue-range-component'` is present in your script and the component is listed in the `components` option of your Vue instance or parent component (e.g., `components: { VueRangeSlider }`).
Warnings
- breaking This package is designed exclusively for Vue.js 2.x and is incompatible with Vue.js 3.x applications. Attempting to use it in a Vue 3 project will result in runtime errors due to fundamental API changes and lack of compatibility updates.
- gotcha The component may fail to initialize correctly or become unresponsive if rendered inside a `v-show="false"` container, with a `display: none` style, or if its position is changed via `transform`, `animation`, or `margin` after initial render.
- deprecated The `vue-range-component` package is abandoned and has not been updated since 2018. It no longer receives bug fixes, security patches, or feature enhancements. Using it in production may introduce security vulnerabilities, compatibility issues with newer browser versions or build tools, and makes future maintenance difficult.
Install
-
npm install vue-range-component -
yarn add vue-range-component -
pnpm add vue-range-component
Imports
- VueRangeSlider
import { VueRangeSlider } from 'vue-range-component'import VueRangeSlider from 'vue-range-component'
- CSS Styles
require('vue-range-component/dist/vue-range-slider.css')import 'vue-range-component/dist/vue-range-slider.css'
- VueRangeSlider (global)
<script src="https://unpkg.com/vue-range-component@1.0.3/dist/vue-range-slider.min.js"></script>
Quickstart
<template>
<div>
<vue-range-slider ref="slider" v-model="value"></vue-range-slider>
</div>
</template>
<script>
import 'vue-range-component/dist/vue-range-slider.css'
import VueRangeSlider from 'vue-range-component'
export default {
data() {
return {
value: 1
}
},
components: {
VueRangeSlider
}
}
</script>