fxycurrencyformat
v3.0.0
Published
vue2国际货币
Downloads
10
Maintainers
Readme
安装
npm i fxycurrencyformat
import fxycurrencyformat from 'fxycurrencyformat'
Vue.use(fxycurrencyformat)使用
<el-input ref="payableFee" v-model="orderForm" v-currency="$CurrencyInput.returnConfig(币种类型0是人民,1是美元)"></el-input>- 使用: 清除数据参数为元素的ref对象
this.$nextTick(()=>{
this.$CurrencyInput.clearableValue(this.$refs.receivableFee)
this.$CurrencyInput.clearableValue(this.$refs.payableFee)
})- 更新数据参数为元素ref对象以及更新的数值
this.$nextTick(()=>{
this.$CurrencyInput.updateValue(this.$refs.receivableFee,value)
this.$CurrencyInput.updateValue(this.$refs.payableFee,value)
})- 国际货币转换数值参数为string,及币种类型
Xxx=this.$CurrencyInput.formattedValue(this.receivableFee,this.currencyType);更有干货
- vue2示例: https://codesandbox.io/s/rv95r?file=/src/App.vue:214-222
- vue3示例: https://codesandbox.io/s/using-vue-currency-input-with-element-plus-8b6rc?from-embed=&file=/src/components/ElCurrencyInput.vue:311-327
