Vue UI Components Documentation
The Vue RangeSelector can easily be used to select a numeric or date range. This guide adds the Vue RangeSelector (jqxRangeSelector) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-scriptsjqwidgets-scripts/jqwidgets-vue3/vue_jqxrangeselector.vue 
In a Vue 3 project (to start one, see Getting started with Vue), add the package:
npm install jqwidgets-scripts
import JqxRangeSelector from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxrangeselector.vue';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.tailwind-blue-dark.css';
With <script setup>, an imported component is ready to use in the template. jqx.base.css is required; the second file is a theme, selected with the theme attribute.
The Default Functionality demo as a Single-File Component:
<template>
<div>
<JqxRangeSelector
ref="myRangeSelector"
:width="width"
:height="100"
:min="0"
:max="200"
:range="{ from: 10, to: 50 }"
:majorTicksInterval="10"
:minorTicksInterval="1"
>
<div id="rangeSelectorContent"></div>
</JqxRangeSelector>
<div style="margin-left: 30px; margin-top: 50px">
<JqxButton @click="onClickSet()"> Set range </JqxButton>
<JqxButton @click="onClickGet()"> Get range </JqxButton>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue';
import JqxRangeSelector from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxrangeselector.vue';
import JqxButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxbuttons.vue';
const myRangeSelector = ref(null);
const width = ref('90%');
function onClickGet() {
// Get Range.
let range = myRangeSelector.value.getRange();
alert('The selected range is from ' + range.from + ' to ' + range.to);
}
function onClickSet() {
// Set Range.
myRangeSelector.value.setRange(30, 70);
}
</script>
<style>
.jqx-button {
width: fit-content;
display: inline-block;
margin-right: 5px;
}
</style>
Options are attributes. Bind values from the script with :, for example :width="850".
Listen to an event with @ and its name. For example, change: This event is triggered when the selected range is changed.
<script setup>
function onChange(event) {
console.log(event.args);
}
</script>
<template>
<JqxRangeSelector @change="onChange" />
</template>
Call methods through a template ref. For example, refresh: Refreshes the range selector.
<script setup>
import { ref, onMounted } from 'vue';
const myRangeSelector = ref(null);
onMounted(() => {
myRangeSelector.value.refresh();
});
</script>
<template>
<JqxRangeSelector ref="myRangeSelector" />
</template>
Every component also has setOptions({ … }) and getOptions('name').