mini-antui
Advanced tools
Comparing version 0.3.11-alpha.2 to 0.3.11
@@ -27,3 +27,3 @@ Component({ | ||
}, | ||
didUpdate: function didUpdate(preProps, preData) { | ||
didUpdate: function didUpdate(preProps) { | ||
var _props2 = this.props, | ||
@@ -34,6 +34,8 @@ value = _props2.value, | ||
if (preProps.value !== this.props.value) { | ||
if (preProps.value !== value) { | ||
var newValue = Math.min(Math.max(min, value), max); | ||
this.setData({ | ||
value: Math.min(Math.max(min, value), max) | ||
value: newValue | ||
}); | ||
this.resetFn(newValue); | ||
} | ||
@@ -58,5 +60,5 @@ }, | ||
var enable = disabled ? disabled : readOnly; | ||
var enable = disabled || readOnly; | ||
if (!enable) { | ||
if (evType === "reduce") { | ||
if (evType === 'reduce') { | ||
if (value > min) { | ||
@@ -68,2 +70,3 @@ opaAdd = 1; | ||
} else { | ||
/* eslint-disable no-lonely-if */ | ||
if (value < max) { | ||
@@ -83,3 +86,8 @@ opaReduce = 1; | ||
}, | ||
resetFn: function resetFn(ev) { | ||
onBlur: function onBlur(event) { | ||
var value = event.detail.value; | ||
this.resetFn(value); | ||
}, | ||
resetFn: function resetFn(value) { | ||
var _props4 = this.props, | ||
@@ -90,10 +98,9 @@ max = _props4.max, | ||
var value = ev.detail.value; | ||
var calculatedVal = value; | ||
var opaAdd = 1; | ||
var opaReduce = 1; | ||
if (value > max) { | ||
if (value >= max) { | ||
calculatedVal = max; | ||
opaAdd = 0.4; | ||
} else if (value < min) { | ||
} else if (value <= min) { | ||
calculatedVal = min; | ||
@@ -100,0 +107,0 @@ opaReduce = 0.4; |
{ | ||
"name": "mini-antui", | ||
"version": "0.3.11-alpha.2", | ||
"version": "0.3.11", | ||
"description": "小程序版AntUI", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
115494
1555
1