mali-applet-ui 1.0.107 → 1.0.108

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.
@@ -54,6 +54,10 @@ export default {
54
54
  type: Number,
55
55
  default: 12
56
56
  },
57
+ digits: {
58
+ type: [Number, String],
59
+ default: 2
60
+ },
57
61
  negative: Boolean,
58
62
  placeholder: {
59
63
  type: String,
@@ -134,7 +138,7 @@ export default {
134
138
  },
135
139
  methods: {
136
140
  updateValue (value) {
137
- this.inpVal = eqEmptyNull(value) ? '' : XEUtils.toFixed(XEUtils.toNumber(value), 2)
141
+ this.inpVal = eqEmptyNull(value) ? '' : XEUtils.toFixed(XEUtils.toNumber(value), this.digits)
138
142
  },
139
143
  checkValue () {
140
144
  const numVal = XEUtils.toNumber(this.inpVal)
@@ -154,7 +158,7 @@ export default {
154
158
  if (eqEmptyNull(this.inpVal) && eqEmptyNull(this.value)) {
155
159
  return { status: false, value: this.inpVal }
156
160
  }
157
- const val = XEUtils.floor(numVal, 2)
161
+ const val = XEUtils.floor(numVal, this.digits)
158
162
  if (`${val}` !== `${this.value}`) {
159
163
  this.updateModel = true
160
164
  this.updateValue(val)
@@ -29,6 +29,10 @@ export default {
29
29
  default: false
30
30
  },
31
31
  unit: Boolean,
32
+ digits: {
33
+ type: [Number, String],
34
+ default: 2
35
+ },
32
36
  underline: Boolean,
33
37
  className: String
34
38
  },
@@ -41,9 +45,9 @@ export default {
41
45
  },
42
46
  amountLabel () {
43
47
  if (this.simplify) {
44
- return toWanAmountString(this.value)
48
+ return toWanAmountString(this.value, this.digits)
45
49
  }
46
- return toAmountString(this.value)
50
+ return toAmountString(this.value, this.digits)
47
51
  }
48
52
  },
49
53
  methods: {
@@ -20,9 +20,10 @@ export default {
20
20
  options: Array,
21
21
  className: String
22
22
  },
23
- data () {
24
- return {
25
-
23
+ inject: {
24
+ layout: {
25
+ from: '$pageLayout',
26
+ default: null
26
27
  }
27
28
  },
28
29
  computed: {
@@ -58,6 +59,11 @@ export default {
58
59
  this.updateTitle(option)
59
60
  this.$emit('input', value)
60
61
  this.$emit('change', { value, option })
62
+ setTimeout(() => {
63
+ if (this.layout && this.layout.clearPadding) {
64
+ this.layout.clearPadding()
65
+ }
66
+ }, 50)
61
67
  }
62
68
  }
63
69
  }
@@ -148,4 +154,4 @@ export default {
148
154
  line-height: 40rpx;
149
155
  }
150
156
  }
151
- </style>
157
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mali-applet-ui",
3
- "version": "1.0.107",
3
+ "version": "1.0.108",
4
4
  "description": "码里云小程序组件库",
5
5
  "files": [
6
6
  "lib",