vant
Version:
Mobile UI Components built on Vue
37 lines (36 loc) • 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
};