Vue UI Components Documentation
The Vue Rating allows you to choose a rating. This guide adds the Vue Rating (jqxRating) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-scriptsjqwidgets-scripts/jqwidgets-vue3/vue_jqxrating.vue 
In a Vue 3 project (to start one, see Getting started with Vue), add the package:
npm install jqwidgets-scripts
import JqxRating from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxrating.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 style="font-size: 13px; font-family: Verdana">
<JqxRating @change="change($event)" :width="350" :height="35"></JqxRating>
<div style="margin-top: 10px">
<div style="float: left">Rating:</div>
<div style="float: left" ref="rateRef"></div>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue';
import JqxRating from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxrating.vue';
const rateRef = ref(null);
function change(event) {
let rate = rateRef.value;
rate.innerHTML = '<span> ' + event.value + '</span>';
}
</script>
<style></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: The change event is triggered when the rating is changed.
<script setup>
function onChange(event) {
console.log(event.args);
}
</script>
<template>
<JqxRating @change="onChange" />
</template>
Call methods through a template ref. For example, val: Sets or gets the value.
<script setup>
import { ref, onMounted } from 'vue';
const myRating = ref(null);
onMounted(() => {
const value = myRating.value.val();
console.log(value);
});
</script>
<template>
<JqxRating ref="myRating" />
</template>
Every component also has setOptions({ … }) and getOptions('name').