更新记录

1.0.0(2021-12-03)

对于国际货币做了进一步的封装,已上传npm 官方供大家使用

0.02(2021-11-29)

兼容 vue2

0.01(2021-11-29)

对vue-currency-input 做了二次封装,兼容到vue2版本

查看更多

平台兼容性

Vue2 Vue3
App 快应用 微信小程序 支付宝小程序 百度小程序 字节小程序 QQ小程序
app-vue app-nvue
钉钉小程序 快手小程序 飞书小程序 京东小程序
× × × ×
H5-Safari Android Browser 微信浏览器(Android) QQ浏览器(Android) Chrome IE Edge Firefox PC-Safari

安装

npm i lvcurrencyinput

import lvcurrencyinput from 'lvcurrencyinput'

Vue.use(lvcurrencyinput)

使用

<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

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT协议

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问