Vue UI Components Documentation
The Vue Notification displays an unobtrusive notification to the user. This guide adds the Vue Notification (jqxNotification) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-scriptsjqwidgets-scripts/jqwidgets-vue3/vue_jqxnotification.vue 
In a Vue 3 project (to start one, see Getting started with Vue), add the package:
npm install jqwidgets-scripts
import JqxNotification from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxnotification.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>
<!--Notifications-->
<JqxNotification
ref="msgNotification"
:width="250"
:position="'top-right'"
:opacity="0.9"
:autoOpen="false"
:autoClose="true"
:animationOpenDelay="800"
:autoCloseDelay="3000"
:template="'info'"
>
<div>Welcome to our website.</div>
</JqxNotification>
<JqxNotification
ref="timeNotification"
:width="250"
:position="'top-right'"
:opacity="0.9"
:autoOpen="false"
:autoClose="true"
:animationOpenDelay="800"
:autoCloseDelay="3000"
:template="'time'"
>
<div>Current time: <span id="currentTime" style="font-weight: bold"></span>.</div>
</JqxNotification>
<!--Layout-->
<JqxButton :width="230" :height="22" @click="onClickOpenMessageNotification()">
Open a message notification
</JqxButton>
<br /><br />
<JqxButton :width="230" :height="22" @click="onClickOpenTimeNotification()">
Open a current time notification
</JqxButton>
</div>
</template>
<script setup>
import { ref } from 'vue';
import JqxNotification from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxnotification.vue';
import JqxButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxbuttons.vue';
const msgNotification = ref(null);
const timeNotification = ref(null);
function onClickOpenMessageNotification() {
msgNotification.value.open();
}
function onClickOpenTimeNotification() {
let date = new Date();
let minutes = date.getMinutes();
let minutesString = '';
if (minutes < 10) {
minutesString = '0' + minutes;
} else {
minutesString = '' + minutes;
}
let seconds = date.getSeconds();
let secondsString = '';
if (seconds < 10) {
secondsString = '0' + seconds;
} else {
secondsString = '' + seconds;
}
let timeSpan = document.getElementById('currentTime');
timeSpan.innerText = date.getHours() + ':' + minutesString + ':' + secondsString;
timeNotification.value.open();
}
</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, click: This event is triggered when the notification is clicked.
<script setup>
function onClick(event) {
console.log(event.args);
}
</script>
<template>
<JqxNotification @click="onClick" />
</template>
Call methods through a template ref. For example, open: Opens the widget.
<script setup>
import { ref, onMounted } from 'vue';
const myNotification = ref(null);
onMounted(() => {
myNotification.value.open();
});
</script>
<template>
<JqxNotification ref="myNotification" />
</template>
Every component also has setOptions({ … }) and getOptions('name').