2
0
mirror of https://github.com/tenrok/maska.git synced 2026-05-21 13:24:06 +03:00
Files
maska/test/components/Callbacks.vue
T
2024-03-30 15:15:31 +03:00

27 lines
676 B
Vue

<script setup lang="ts">
import { ref } from 'vue';
import { MaskInputOptions, vMaska } from '../../src'
const emit = defineEmits(['mask1', 'mask2', 'mask3'])
const bound1 = ref('')
const bound2 = ref('')
const options1 = <MaskInputOptions>{
onMaska: (detail) => emit('mask1', detail)
}
const options2 = <MaskInputOptions>{
onMaska: [
(detail) => emit('mask2', detail),
(detail) => emit('mask3', detail),
]
}
</script>
<template>
<input id="input1" v-maska:bound1="options1" data-maska="#-#" />
<input id="input2" v-maska:bound2="options2" data-maska="#-#" />
<div class="bound1">{{ bound1 }}</div>
<div class="bound2">{{ bound2 }}</div>
</template>