vue-naira-input
v1.1.2
Published
A Vue component for inputting Naira-formatted amounts.
Downloads
2
Readme
vue-naira-input
A Vue component for inputting Naira-formatted amounts.
Installation
npm i -S vue-naira-input
Browser
<script type="text/javascript" src="https://unpkg.com/vue"></script>
<script type="text/javascript" src="https://unpkg.com/vue-naira-input"></script>
<script type="text/javascript">
Vue.use(NairaInput);
</script>
Module
import NairaInput from 'vue-naira-input';
Usage
Once installed, it can be used in a template as simply as:
<naira-input ref="nairaInput" :initial-amount="initialAmount" v-model="amount" />
Or styled as a Bootstrap input:
<naira-input class="form-control" ref="nairaInput" :initial-amount="initialAmount" v-model="amount" />
The currency prefix can be changed:
<naira-input ref="nairaInput" currency-symbol="$" :initial-amount="initialAmount" v-model="amount" />
To clear the input, call:
this.$refs.nairaInput.clear();
To reset the input to the initial value, call:
this.$refs.nairaInput.reset();