yqform-edit 1.0.21 → 1.0.22

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": "yqform-edit",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "private": false,
5
5
  "main": "dist/yqform-edit.umd.min.js",
6
6
  "scripts": {
@@ -232,7 +232,6 @@
232
232
  v-model="question.amount"
233
233
  @focus="inputFocus"
234
234
  type="float"
235
- ref="payInput"
236
235
  @blur="blurPayItem"
237
236
  :center="true" />
238
237
  </van-cell-group>
@@ -482,11 +481,16 @@ export default {
482
481
  watch: {
483
482
  item: {
484
483
  handler(newItem, oldItem) {
485
- console.log('newItem, oldItem', newItem, oldItem)
484
+ // console.log('newItem, oldItem', newItem, oldItem)
486
485
  if (!newItem) {
487
486
  this.noSelectItem = true
488
487
  } else {
489
488
  this.noSelectItem = false
489
+ if (newItem.type === 'pay' && newItem.amount <= 0) {
490
+ this.payError = '支付金额必须大于0'
491
+ } else {
492
+ this.payError = ''
493
+ }
490
494
  }
491
495
  this.defaultCheck = []
492
496
  if (this.question.type === 'period' || this.question.type === 'instant') {
@@ -509,9 +513,6 @@ export default {
509
513
  this.hintRangeShow = false
510
514
  this.hintTextShow = false
511
515
  }
512
- if (this.question.type === 'pay') {
513
- setTimeout(() => this.$refs.payInput.focus())
514
- }
515
516
  this.dependsData = []
516
517
  this.showAddDepend = false
517
518
  this.showAddOption = false
@@ -875,12 +876,7 @@ export default {
875
876
  e.target.select()
876
877
  },
877
878
  blurPayItem() {
878
- if (this.question.amount <= 0) {
879
- this.payError = '支付金额必须大于0'
880
- } else {
881
- this.payError = ''
882
- this.question.amount = (this.question.amount * 1).toFixed(2)
883
- }
879
+ this.question.amount = (this.question.amount * 1).toFixed(2)
884
880
  }
885
881
  },
886
882
  }