mirror of
https://github.com/tenrok/maska.git
synced 2026-05-15 11:59:38 +03:00
cd1e9f3564
- new directive format: pass options as value, bound as argument with modifiers - update and checkValue methods in MaskInput
22 lines
394 B
Vue
22 lines
394 B
Vue
<script setup lang="ts">
|
|
import { ref } from 'vue'
|
|
import { MaskInputOptions, vMaska } from '../../src'
|
|
|
|
const bound = ref('')
|
|
const config = <MaskInputOptions>{
|
|
mask: 'A A',
|
|
tokens: {
|
|
A: {
|
|
pattern: /[A-Z]/,
|
|
multiple: true,
|
|
transform: (chr) => chr.toUpperCase()
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<input v-maska:bound="config" />
|
|
<div>{{ bound }}</div>
|
|
</template>
|