Vue UI Components Documentation
The Vue Window enables you to direct a user’s attention to a particular activity in your web application, such as entering data or viewing information. This guide adds the Vue Window (jqxWindow) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-scriptsjqwidgets-scripts/jqwidgets-vue3/vue_jqxwindow.vue 
In a Vue 3 project (to start one, see Getting started with Vue), add the package:
npm install jqwidgets-scripts
import JqxWindow from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxwindow.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 id="jqxWidget">
<div style="float: left">
<div>
<JqxButton
ref="showWindowButton"
:width="75"
:height="'auto'"
@click="showWindowButtonClicked()"
>
Open
</JqxButton>
<JqxButton
ref="hideWindowButton"
:width="65"
:height="'auto'"
@click="hideWindowButtonClicked()"
>
Close
</JqxButton>
</div>
<div class="clear"></div>
<div style="margin-top: 10px">
<JqxCheckbox :checked="true" @change="resizeChange($event)">Resizable</JqxCheckbox>
<JqxCheckbox :checked="true" @change="dragChange($event)">Enable drag</JqxCheckbox>
</div>
</div>
<JqxWindow
ref="window"
:width="500"
:height="300"
:showCollapseButton="true"
:initContent="init"
:maxHeight="400"
:maxWidth="700"
:minHeight="200"
:minWidth="200"
>
<div>
<span>
<img
src="https://www.jqwidgets.com/vue/images/movie.png"
alt=""
style="margin-right: 15px"
/>Movies
</span>
</div>
<div>
<JqxTabs ref="tab" :autoCreate="false">
<ul style="margin-left: 30px">
<li>Avatar</li>
<li>End Game</li>
<li>Twilight</li>
<li>Unstoppable</li>
<li>Priest</li>
</ul>
<div>
<img
src="https://www.jqwidgets.com/vue/images/avatar.png"
style="float: left; margin: 10px"
alt=""
/>
Avatar is a 2009 American[6][7] epic science fiction film written and
directed by James Cameron, and starring Sam Worthington, Zoe Saldana,
Stephen Lang, Michelle Rodriguez, Joel David Moore, Giovanni Ribisi and
Sigourney Weaver. The film is set in the mid-22nd century, when humans are
mining a precious mineral called unobtanium on Pandora , a lush habitable
moon of a gas giant in the Alpha Centauri star system. The expansion of the
mining colony threatens the continued existence of a local tribe of Na'vi—a
humanoid species indigenous to Pandora. The film's title refers to the
genetically engineered Na'vi-human hybrid bodies used by a team of
researchers to interact with the natives of Pandora.
</div>
<div>
<img
src="https://www.jqwidgets.com/vue/images/endgame.png"
style="float: left; margin: 10px"
alt=""
/>
End Game is a 2006 action/thriller film, written and directed by Andy Cheng.
The film stars Cuba Gooding, Jr. as Secret Service agent Alex Thomas, who is
shot in the hand, while unsuccessfully trying to protect the President
(played by Jack Scalia) from an assassin's bullet. Later, with the help of a
persistent newspaper reporter named Kate Crawford (played by Angie Harmon),
he uncovers a vast conspiracy behind what initially appeared to be a lone
gunman. James Woods, Burt Reynolds, and Anne Archer co–star in this film
that was originally set to be shown in cinemas by MGM in 2005, but was
delayed by the takeover from Sony and eventually sent direct to DVD.
</div>
<div>
<img
src="https://www.jqwidgets.com/vue/images/twilight.png"
style="float: left; margin: 10px"
alt=""
/>
The project was in development for approximately three years at Paramount
Pictures, during which time a screen adaptation that differed significantly
from the novel was written. Summit Entertainment acquired the rights to the
novel after three years of the project's stagnant development. Melissa
Rosenberg wrote a new adaptation of the novel shortly before the 2007–2008
Writers Guild of America strike and sought to be faithful to the novel's
storyline. Principal photography took 44 days, and completed on May 2, 2008;
the film was primarily shot in Oregon
</div>
<div>
<img
src="https://www.jqwidgets.com/vue/images/unstoppable.png"
style="float: left; margin: 10px"
alt=""
/>
Meanwhile, in a rail yard within the northern town of Fuller, two AWVR
hostlers, Dewey (Ethan Suplee) and Gilleece (T.J. Miller), are ordered by
Fuller operations dispatcher Bunny (Kevin Chapman) to move a freight train
led by locomotive #777 (nicknamed "Triple Seven") off its current track to
clear the track for an excursion train carrying schoolchildren. Dewey
attempts to take shortcuts, instructing Gilleece to leave the hoses for the
air brakes disconnected for the short trip. Dewey later leaves the moving
cab to throw a misaligned rail switch along the train's path, but is unable
to climb back on, as the train's throttle jumps from idle, to full power. He
is forced to report the train as a "coaster" to Fuller yardmaster Connie
Hooper (Rosario Dawson)...
</div>
<div>
<img
src="https://www.jqwidgets.com/vue/images/priest.png"
style="float: left; margin: 10px"
alt=""
/>
Priest is a 2011 American post-apocalyptic sci-fi western and supernatural
action film starring Paul Bettany as the title character. The film, directed
by Scott Stewart, is based on the Korean comic of the same name. In an
alternate world, humanity and vampires have warred for centuries. After the
last Vampire War, the veteran Warrior Priest (Bettany) lives in obscurity
with other humans inside one of the Church's walled cities. When the
Priest's niece (Lily Collins) is kidnapped by vampires, the Priest breaks
his vows to hunt them down. He is accompanied by the niece's boyfriend (Cam
Gigandet), who is a wasteland sheriff, and a former Warrior Priestess
(Maggie Q).
</div>
</JqxTabs>
</div>
</JqxWindow>
</div>
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxWindow from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxwindow.vue';
import JqxTabs from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxtabs.vue';
import JqxButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxbuttons.vue';
import JqxCheckbox from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxcheckbox.vue';
const tab = ref(null);
const window = ref(null);
function init() {
let options = { width: '100%', height: '99%' };
tab.value.createComponent(options);
}
function showWindowButtonClicked() {
window.value.open();
}
function hideWindowButtonClicked() {
window.value.close();
}
function resizeChange(event) {
if (event.args.checked) {
window.value.resizable = true;
} else {
window.value.resizable = false;
}
}
function dragChange(event) {
if (event.args.checked) {
window.value.draggable = true;
} else {
window.value.draggable = false;
}
}
onMounted(() => {
let jqxWidget = document.getElementById('jqxWidget');
let offsetLeft = jqxWidget.offsetLeft;
let offsetTop = jqxWidget.offsetTop;
window.value.position = { x: offsetLeft + 50, y: offsetTop + 50 };
});
</script>
<style>
.jqx-button {
float: left;
}
.jqx-button:last-child {
margin-left: 5px;
}
.clear {
clear: both;
}
</style>Options are attributes. Bind values from the script with :, for example :width="850".
Listen to an event with @ and its name. For example, open: This event is triggered when the window is displayed.
<script setup>
function onOpen(event) {
console.log(event.args);
}
</script>
<template>
<JqxWindow @open="onOpen" />
</template>
Call methods through a template ref. For example, open: Opening/showing the current window.
<script setup>
import { ref, onMounted } from 'vue';
const myWindow = ref(null);
onMounted(() => {
myWindow.value.open();
});
</script>
<template>
<JqxWindow ref="myWindow" />
</template>
Every component also has setOptions({ … }) and getOptions('name').