Vue UI Components Documentation
The Vue ScrollView can be used for viewing content which is wider than the visible area outlined by the device's screen. This guide adds the Vue ScrollView (jqxScrollView) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-scriptsjqwidgets-scripts/jqwidgets-vue3/vue_jqxscrollview.vue 
In a Vue 3 project (to start one, see Getting started with Vue), add the package:
npm install jqwidgets-scripts
import JqxScrollView from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxscrollview.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>
<JqxScrollView ref="myScrollView" :width="600" :height="450" :buttonsOffset="[0, 0]">
<div>
<div
class="photo"
style="
background-image: url(https://www.jqwidgets.com/vue/images/imageNature1.jpg);
"
></div>
</div>
<div>
<div
class="photo"
style="
background-image: url(https://www.jqwidgets.com/vue/images/imageNature2.jpg);
"
></div>
</div>
<div>
<div
class="photo"
style="
background-image: url(https://www.jqwidgets.com/vue/images/imageNature3.jpg);
"
></div>
</div>
<div>
<div
class="photo"
style="
background-image: url(https://www.jqwidgets.com/vue/images/imageNature4.jpg);
"
></div>
</div>
<div>
<div
class="photo"
style="
background-image: url(https://www.jqwidgets.com/vue/images/imageNature5.jpg);
"
></div>
</div>
</JqxScrollView>
<div style="margin-top: 2em"></div>
<JqxButton @click="onStartClicked()" :width="120"> Start SlideShow </JqxButton>
<JqxButton @click="onStopClicked()" :width="120"> Stop SlideShow </JqxButton>
</div>
</template>
<script setup>
import { ref } from 'vue';
import JqxScrollView from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxscrollview.vue';
import JqxButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxbuttons.vue';
const myScrollView = ref(null);
function onStartClicked(event) {
myScrollView.value.slideShow = true;
}
function onStopClicked(event) {
myScrollView.value.slideShow = false;
}
</script>
<style>
.photo {
width: 600px;
height: 450px;
background-color: #000;
background-position: center;
background-repeat: no-repeat;
}
.jqx-button {
display: inline-block;
margin-right: 10px;
}
</style>Options are attributes. Bind values from the script with :, for example :width="850".
Listen to an event with @ and its name. For example, pageChanged: This event is triggered when the current page is changed.
<script setup>
function onPageChanged(event) {
console.log(event.args);
}
</script>
<template>
<JqxScrollView @pageChanged="onPageChanged" />
</template>
Call methods through a template ref. For example, refresh: Refreshes the widget.
<script setup>
import { ref, onMounted } from 'vue';
const myScrollView = ref(null);
onMounted(() => {
myScrollView.value.refresh();
});
</script>
<template>
<JqxScrollView ref="myScrollView" />
</template>
Every component also has setOptions({ … }) and getOptions('name').