2
0
mirror of https://github.com/tenrok/maska.git synced 2026-06-14 18:42:27 +03:00

Callback onMaska now can accept array

To make it possible use callback with binded value
This commit is contained in:
Alexander Shabunevich
2022-12-07 11:34:02 +03:00
parent 2d594a4837
commit 57f4f44959
5 changed files with 90 additions and 3 deletions
+24
View File
@@ -0,0 +1,24 @@
<script setup lang="ts">
import { reactive } from 'vue';
import { MaskaDetail, vMaska } from '../../src'
const emit = defineEmits(['mask1', 'mask2', 'mask3'])
const binded1 = reactive({})
const binded2 = reactive({})
const options1 = {
onMaska: (detail: MaskaDetail) => emit('mask1', detail)
}
const options2 = {
onMaska: [
(detail: MaskaDetail) => emit('mask2', detail),
(detail: MaskaDetail) => emit('mask3', detail),
]
}
</script>
<template>
<input id="input1" v-maska:[options1]="binded1" data-maska="#-#" />
<input id="input2" v-maska:[options2]="binded2" data-maska="#-#" />
</template>