vue-brazil-money

1.0.0 • Public • Published

npm npm npm

vue-brazil-money

If you just want a Vue 3 library to format brazillian money and don't want to configure anything, this library is perfect to you. https://www.npmjs.com/package/vue-brazil-money

npm install vue-brazil-money

How to use

<template>
    <money v-model="test" />
</template>

<script>
import money from "vue-brazil-money";
export default {
  name: "App",
  data() {
    return {
      test: "",
    };
  },
  components: {
    money,
  },
};
</script>

Attrs

You can pass attributes to input, like disabled, class etc
<template>
  <div>
    <p>Returned value {{ test }}</p>
    Formatted value:
    <money v-model="test" id="money-input" class="text-red" />
  </div>
</template>

<script>
import money from "vue-brazil-money";
export default {
  name: "App",
  data() {
    return {
      test: "",
    };
  },
  components: {
    money,
  },
};
</script>
<style>
.text-red {
  color: red;
}
</style>

Props

You can inform the decimal places. The default value is 2
<money v-model="test" :decimalPlaces="5" />

Example

Screenshot from 2022-12-21 21-46-58

Authors

  • Victorio Capucco
  • Wellington Rosendo

References

"Como criar e publicar uma biblioteca (em Vue) no npm?" -> https://medium.com/tableless/como-criar-e-publicar-uma-biblioteca-em-vue-no-npm-2dff8271ca7d

Package Sidebar

Install

npm i vue-brazil-money

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

66.5 kB

Total Files

10

Last publish

Collaborators

  • victoriocapucco