sadais-piui 1.2.7-beta93 → 1.2.7-beta94
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.
|
@@ -43,7 +43,7 @@ const { stepper } = getConfig()
|
|
|
43
43
|
const TAG = 'PiStepper'
|
|
44
44
|
|
|
45
45
|
export default {
|
|
46
|
-
name:
|
|
46
|
+
name: TAG,
|
|
47
47
|
// 混入v-model
|
|
48
48
|
mixins: [ValueSync],
|
|
49
49
|
props: {
|
|
@@ -299,8 +299,8 @@ export default {
|
|
|
299
299
|
this.handleInputChange({ detail: { value: `${val}` } })
|
|
300
300
|
},
|
|
301
301
|
handleInputChange(e) {
|
|
302
|
-
|
|
303
|
-
const reg =
|
|
302
|
+
let val = e.detail.value
|
|
303
|
+
const reg = /^-?\d*\.?\d+$/
|
|
304
304
|
const result = val.match(reg)
|
|
305
305
|
const decimal = this.decimal
|
|
306
306
|
if (!result) {
|
|
@@ -313,6 +313,7 @@ export default {
|
|
|
313
313
|
const dot = result[2]
|
|
314
314
|
const right = result[3]
|
|
315
315
|
let tmpVal = ''
|
|
316
|
+
|
|
316
317
|
if (!dot || !right) {
|
|
317
318
|
tmpVal = dot ? `${left}${dot}` : left
|
|
318
319
|
} else if (/^\d+/.test(right)) {
|
|
@@ -324,10 +325,7 @@ export default {
|
|
|
324
325
|
// 若小数点右边不是以数字开头
|
|
325
326
|
tmpVal = `${left}${dot}`
|
|
326
327
|
}
|
|
327
|
-
// target.value = tmpVal
|
|
328
|
-
console.log(`tmpVal = ${tmpVal}`)
|
|
329
328
|
this.val = 0
|
|
330
|
-
// this.handleEmitChange()
|
|
331
329
|
this.$nextTick(() => {
|
|
332
330
|
let tmp = parseFloat(tmpVal)
|
|
333
331
|
if (this.integer) {
|