wirecardBrasil / awesome-mask

The awesome-mask runs with Vue.js and uses the vanilla-masker to make your form awesome with masks.
MIT License
165 stars 22 forks source link

Added decimal support, changed implementation syntax #36

Closed HenryP3 closed 6 years ago

HenryP3 commented 6 years ago

With this new decimal support the implementation of money mask that was:

<input v-model="price" v-mask="'money'"/>

Should be now:

<template>
   <input v-model="price" v-mask="money"/>
</template>
<script>
   [...]
   export default {
      data () {
         return {
            price: null,
            money: {
               mask: 'money',
               precision: 2 // defines the number of zeroes after the decimal separator
            }
         }
      }
   }
</script>