mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-24 02:16:12 +08:00
[Improvement] optimize babel plugin (#1117)
This commit is contained in:
parent
b5139b18eb
commit
e95107f14c
26
.babelrc
26
.babelrc
@ -1,14 +1,30 @@
|
|||||||
{
|
{
|
||||||
"presets": [["env", { "modules": false, "loose": true }]],
|
"presets": [
|
||||||
|
[
|
||||||
|
"env",
|
||||||
|
{
|
||||||
|
"modules": false,
|
||||||
|
"loose": true,
|
||||||
|
"exclude": ["transform-es2015-typeof-symbol"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
"plugins": ["transform-runtime", "transform-object-rest-spread"],
|
"plugins": ["transform-runtime", "transform-object-rest-spread"],
|
||||||
"env": {
|
"env": {
|
||||||
"commonjs": {
|
"commonjs": {
|
||||||
"presets": [["env", { "modules": "commonjs", "loose": true }]]
|
"presets": [
|
||||||
|
[
|
||||||
|
"env",
|
||||||
|
{
|
||||||
|
"modules": "commonjs",
|
||||||
|
"loose": true,
|
||||||
|
"exclude": ["transform-es2015-typeof-symbol"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"presets": [
|
"presets": [["env", { "targets": { "node": 8 } }]]
|
||||||
["env", { "targets": { "node": 8 }}]
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ export default create({
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
correctValue(value) {
|
correctValue(value) {
|
||||||
return Number.isNaN(value)
|
return isNaN(value)
|
||||||
? this.min
|
? this.min
|
||||||
: Math.max(this.min, Math.min(this.max, value));
|
: Math.max(this.min, Math.min(this.max, value));
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user