UNPKG

vue-currency-symbol

Version:

A simple VueJs library that returns different currency badges.

53 lines (26 loc) 1.23 kB
# vue-currency-symbol [![NPM](https://nodei.co/npm/vue-cureency-symbol.png?downloads=true)](https://nodei.co/npm/vue-currency-symbol/) [![npm version](https://badge.fury.io/js/vue-currency-symbol.svg)](https://badge.fury.io/js/vue-currency-symbol) A simple VueJs library that returns different currency badges. ### Installation ``` Javascript npm install vue-currency-symbol ``` ### Usage To install the plugin, in your entry file, (this is usually `src/main.js` when you initialize your project using `vue-cli`), install the plugin using `Vue.use()`. ```javascript // - src/main.js import Vue from 'vue' import CurrencyBadge from 'vue-currency-symbol' ... Vue.use(CurrencyBadge) ... ``` Use `currencySymbol(countryName)` to get the corresponding country currency badge/symbol. Also, passing in currency name or country abbreviation would also return the currency badge. #### Note Use as a value of `v-html` directive. #### Example Adding `<span v-html="currencySymbol('japan')"></span>` to the element you want to use the symbol returns Japanese Yen symbol. `// ¥`