🔡 Tiny input mask library for Vue.js (directive)
One of the common use cases for that is number as formatting currencies:
<template>
<span>{{ '1000' | VMask(currencyMask) }</span>
<!-- prints `$1,000` -->
</template>
<script>
import createNumberMask from 'text-mask-addons/dist/createNumberMask';
const currencyMask = createNumberMask({
prefix: '$',
allowDecimal: true,
includeThousandsSeparator: true,
allowNegative: false,
});
export default {
data: () => ({
currencyMask,
myInputModel: ''
})
}
</script>
Thanks to @CristianUser for the idea.
pureMask
and use text-mask-core
instead (9dad736)text-mask-core
.May not work as expected but it bring some future to the library. Please create an issue if you have any issues with v2.X If you satisfied with v1 - keep using it. It was almost 2x times smaller
More improvements soon!