Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump browserslist from 4.12.0 to 4.16.6 #4

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
node_modules/
dist/
npm-debug.log
101 changes: 101 additions & 0 deletions App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<template>
<div></div>
</template>

<script>
//import axios from "axios";
//import forIn from "lodash";
import codes from "./currency.js";
import pop from "./popularCurrencies";

export default {
name: "app",
created() {
codes.map((code) => {
this.currencyData.push({
id: code.code,
curr: code.name,
});
});
this.loadPop();
},
data() {
return {
currencyData: [],
conv: [],
popularCurrencies: [],
curr: 1,
currA: "",
currB: "",
currId: "",
cc: [],
clicked: false,
};
},
methods: {
convert() {
this.clicked = true;

var opt = "";
this.conv.map((c) => {
c.curr === this.currB ? (opt = c.id) : null;
});
this.cc = [
{
amount: this.curr,
base: this.currA,
quote: opt,
total: (this.curr * this.currB).toFixed(2),
},
];
},
loadConversions() {
axios
.get(`http://api.fixer.io/latest?base=${this.currA}`)
.then((response) => {
_.forIn(response.data.rates, function (value, key) {
this.conv.push({ id: key, curr: value });
});
})
.catch((error) => {
throw new error();
});
this.conv = [];
},
loadPop() {
pop.map((currency) => {
this.popularCurrencies.push({
name: currency.name,
code: currency.code,
symbol: currency.symbol,
});
});
},
},
};
</script>
<style>
.el-menu {
background-color: #20a0ff;
margin-bottom: 25px;
}
h3 {
font-family: "helvetica";
color: gray;
text-align: center;
}
h1 {
margin-left: 10px;
font-family: "helvetica";
color: ghostwhite;
font-size: 20px large;
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.11s;
}
.fade-enter,
.fade-leave-active {
opacity: 0;
}
</style>
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
# currency-converter
Simple currency converter app built with Vue.js 2.0

> currency converter created with Vue.js

Currency Converter leverages Fixer.io's foreign exchange rates and currency conversion API to deliver reliable, up-to-date currency rates and accurate currency conversions.

Currency Converter currently supports many of the world's leading currencies; however, there are plans to offer more currency rates and conversions in the future.

## Usage

```bash

# clone the repo
git clone https://github.com/p-adams/currency-converter

# install dependencies
npm install

# run the server
npm run dev

```
Loading