perf: add truthProp util (#8522)

* perf: add TruthyProp util

* chore: rename

* chore: upd
This commit is contained in:
neverland
2021-04-14 10:26:21 +08:00
committed by GitHub
parent 9381640d2e
commit bd609e1df0
59 changed files with 226 additions and 460 deletions
+5 -16
View File
@@ -17,6 +17,7 @@ import {
import {
range,
isHidden,
truthProp,
preventDefault,
createNamespace,
ComponentInstance,
@@ -37,15 +38,15 @@ const [name, bem] = createNamespace('swipe');
export const SWIPE_KEY = Symbol(name);
const props = {
loop: truthProp,
width: [Number, String],
height: [Number, String],
vertical: Boolean,
touchable: truthProp,
lazyRender: Boolean,
indicatorColor: String,
loop: {
type: Boolean,
default: true,
},
showIndicators: truthProp,
stopPropagation: truthProp,
autoplay: {
type: [Number, String],
default: 0,
@@ -54,22 +55,10 @@ const props = {
type: [Number, String],
default: 500,
},
touchable: {
type: Boolean,
default: true,
},
initialSwipe: {
type: [Number, String],
default: 0,
},
showIndicators: {
type: Boolean,
default: true,
},
stopPropagation: {
type: Boolean,
default: true,
},
};
export type SwipeToOptions = {