Vue UI Components Documentation
The Vue MaskedInput uses a mask to distinguish between proper and improper user input. This guide adds the Vue MaskedInput (jqxMaskedInput) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-scriptsjqwidgets-scripts/jqwidgets-vue3/vue_jqxmaskedinput.vue 
In a Vue 3 project (to start one, see Getting started with Vue), add the package:
npm install jqwidgets-scripts
import JqxMaskedInput from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxmaskedinput.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>
<div id="jqxWidget" style="font-size: 13px; font-family: Verdana">
<div style="margin-top: 10px">Numeric</div>
<JqxMaskedInput ref="numericInput" :width="250" :height="25"> </JqxMaskedInput>
<div style="margin-top: 10px">Zip Code</div>
<JqxMaskedInput ref="zipCodeInput" :mask="'#####-####'" :width="250" :height="25">
</JqxMaskedInput>
<div style="margin-top: 10px">SSN</div>
<JqxMaskedInput ref="ssnInput" :mask="'###-##-####'" :width="250" :height="25">
</JqxMaskedInput>
<div style="margin-top: 10px">Phone Number</div>
<JqxMaskedInput ref="phoneInput" :mask="'(###)###-####'" :width="250" :height="25">
</JqxMaskedInput>
<div style="margin-top: 10px">IP Address (ex: 255.255.255.255)</div>
<JqxMaskedInput
ref="regexInput"
:mask="'[0-2][0-5][0-5].[0-2][0-5][0-5].[0-2][0-5][0-5].[0-2][0-5][0-5]'"
:width="250"
:height="25"
>
</JqxMaskedInput>
<div style="margin-top: 10px">Disabled</div>
<JqxMaskedInput ref="disabledInput" :disabled="true" :width="250" :height="25">
</JqxMaskedInput>
</div>
<br />
<JqxButton @click="clear()" :width="120">Clear Values</JqxButton>
</div>
</template>
<script setup>
import { ref } from 'vue';
import JqxMaskedInput from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxmaskedinput.vue';
import JqxButton from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxbuttons.vue';
const numericInput = ref(null);
const zipCodeInput = ref(null);
const ssnInput = ref(null);
const phoneInput = ref(null);
const regexInput = ref(null);
const disabledInput = ref(null);
function clear() {
numericInput.value.clear();
zipCodeInput.value.clear();
ssnInput.value.clear();
phoneInput.value.clear();
regexInput.value.clear();
disabledInput.value.clear();
}
</script>
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 value is changed and the control's focus is lost.
<script setup>
function onChange(event) {
console.log(event.args);
}
</script>
<template>
<JqxMaskedInput @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 myMaskedInput = ref(null);
onMounted(() => {
const value = myMaskedInput.value.val();
console.log(value);
});
</script>
<template>
<JqxMaskedInput ref="myMaskedInput" />
</template>
Every component also has setOptions({ … }) and getOptions('name').