58 lines
1.0 KiB
Vue
58 lines
1.0 KiB
Vue
<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(queryParams).then(response => {
|
|
this.value = response.data;
|
|
});
|
|
},
|
|
|
|
}
|
|
};
|
|
</script>
|