1.1.5 • Published 5 years ago

qed-currencies-converter v1.1.5

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

QED Currency Converter

Install

npm i --save qed-currencies-converter

Preview (style-1)

Component Preview

    import QedCurrencyConverter from 'qed-currencies-converter'
    import 'qed-currencies-converter/dist/qed-currency-converter-style.css'

Preview (style-2)

Component Preview

    import QedCurrencyConverter from 'qed-currencies-converter'
    import 'qed-currencies-converter/dist/qed-currency-converter-style-2.css'

Usage

Import component

    import QedCurrencyConverter from 'qed-currencies-converter'
    import 'qed-currencies-converter/dist/qed-currency-converter-style.css'

    const app = new Vue({
        components: {
            QedCurrencyConverter,
        }
    };
<div>
    <qed-currency-converter :config="config"/>
</div>

Config Example

const config = {
    // Api key for unlimited requests per minute -> api key is not required if you use your own rate provider
    apiKey: 'here-comes-your-api-key',

    // You can override default exchange api with your own route (response example json => { rate: 1.2 })
    route:'/api/currencies/rate',

    // Whether rate will be displayed (true/false)
    displayRate:true,
    
    // Currency list, iso name is sent to previously defined route ex ${route}?from="eur"&to="usd"
    currencies: [
        {
            symbol:'$',
            iso: 'usd'
        },
        {
            symbol: '€',
            iso: 'eur'
        }
    ],

    // Simple backup function if you do not want to use live rates, or in case your currency rate provider goes offline 
    backupRateFunction(from, to) {
        if (from.iso == 'EUR' && from.iso == 'USD') {
            return 1.12;
        }
        // else if () ....... 
         
        return 1;
    }
}

API KEY

  • Api key is required only if you wish to use predefined api exchange rate provider with unlimited requests per minute
  • This way all you have to do is set up list of currencies you wish to use on your site
  • Api key is also free and can be obtained here -> https://exchange.qed.services

License

MIT

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago