This commit is contained in:
linfso 2024-07-18 20:06:17 +08:00
parent a9f50bc4be
commit c4b64a8abe

View File

@ -0,0 +1,57 @@
<template>
<div>
{{from}}->{{to}}:{{ svalue }}
</div>
</template>
<script>
import { getValidExchangeRate } from "@/api/emis/emisExchangeRate";
export default {
name: "ExchangeRatePanel",
props: {
value: {
type: String,
required: false
},
from: {
type: String,
required: false
},
to: {
type: String,
required: false
},
placeholder: {
type: String,
required: false
},
},
data() {
return {
svalue: this.value,
};
},
watch: {
from(newVal,oldVal) {
this.queryData();
},
to(newVal,oldVal) {
this.queryData();
}
},
created() {
this.queryData();
},
methods: {
queryData() {
let queryParams = {
from:this.from,
to:this.to
};
getValidExchangeRate(this.queryParams).then(response => {
this.value = response.data;
});
},
}
};
</script>