sf-cff / app.js
xcoolcoinx's picture
Add 3 files
bae80b1
raw
history blame contribute delete
601 Bytes
import Alpine from "alpinejs";
Alpine.start();
const app = new Vue({
el: "#app",
data: {
amount: null,
from: null,
to: null,
},
methods: {
submit() {
const fromCurrency = this.from;
const toCurrency = this.to;
if(fromCurrency && toCurrency){
return(html`<h1>The amount of ${amount} in ${fromCurrency} is ${conversion(amount, fromCurrency, toCurrency)} in ${toCurrency}!</h1>`);
} else {
return(html`<h1>Please select a currency!</h1>`);
}
},
conversion(amount, fromCurrency, toCurrency){
// Conversion logic
}
},
});