ckgl/node_modules/vant/es/utils/props.mjs
2024-12-21 13:52:42 +08:00

37 lines
661 B
JavaScript

const unknownProp = null;
const numericProp = [Number, String];
const truthProp = {
type: Boolean,
default: true
};
const makeRequiredProp = (type) => ({
type,
required: true
});
const makeArrayProp = () => ({
type: Array,
default: () => []
});
const makeNumberProp = (defaultVal) => ({
type: Number,
default: defaultVal
});
const makeNumericProp = (defaultVal) => ({
type: numericProp,
default: defaultVal
});
const makeStringProp = (defaultVal) => ({
type: String,
default: defaultVal
});
export {
makeArrayProp,
makeNumberProp,
makeNumericProp,
makeRequiredProp,
makeStringProp,
numericProp,
truthProp,
unknownProp
};