t20-common-lib 0.15.29 → 0.15.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "t20-common-lib",
3
- "version": "0.15.29",
3
+ "version": "0.15.31",
4
4
  "description": "T20",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -12,7 +12,7 @@
12
12
  :type="type"
13
13
  :is-clearable="true"
14
14
  v-model="_value"
15
- :d-num="6"
15
+ :d-num="$attrs.dNum ? $attrs.dNum : 6"
16
16
  :placeholder="$attrs.placeholder ? $attrs.placeholder : '请输入' | $l"
17
17
  v-bind="$attrs"
18
18
  v-on="$listeners"
@@ -192,10 +192,11 @@ export default {
192
192
  if (Number.isNaN(n)) return val
193
193
  return n.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ',')
194
194
  },
195
- formatRate(val) {
195
+ formatRate(val, props) {
196
+ const dNum = props?.dNum ? props.dNum : 6
196
197
  const n = Number(val)
197
198
  if (Number.isNaN(n)) return val
198
- return String(n)
199
+ return n.toFixed(dNum)
199
200
  },
200
201
  labelFromOptions(options, raw, multiple) {
201
202
  const opts = options || []
@@ -249,7 +250,7 @@ export default {
249
250
  case 'AMOUNT':
250
251
  return this.formatMoney(raw)
251
252
  case 'RATE':
252
- return this.formatRate(raw)
253
+ return this.formatRate(raw, item.props)
253
254
  case 'DATE_RANGE': {
254
255
  const s = String(raw)
255
256
  const parts = s.split(',')