mirror of
https://github.com/tenrok/maska.git
synced 2026-05-15 11:59:38 +03:00
22 lines
458 B
Vue
22 lines
458 B
Vue
<script setup lang="ts">
|
|
import { reactive } from 'vue'
|
|
import { vMaska, MaskaDetail, MaskInputOptions } from '../../src'
|
|
|
|
const bound = reactive<Partial<MaskaDetail>>({})
|
|
const config = reactive<MaskInputOptions>({
|
|
mask: 'A A',
|
|
tokens: {
|
|
A: {
|
|
pattern: /[A-Z]/,
|
|
multiple: true,
|
|
transform: (chr) => chr.toUpperCase()
|
|
}
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<input v-maska:[config]="bound" />
|
|
<div>{{ bound.masked }}</div>
|
|
</template>
|