You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
545 B
22 lines
545 B
const SOURCE_TYPES = ['album', 'camera']
|
|
|
|
export const chooseVideo = {
|
|
sourceType: {
|
|
type: Array,
|
|
required: false,
|
|
default: SOURCE_TYPES,
|
|
validator (sourceType, params) {
|
|
const length = sourceType.length
|
|
if (!length) {
|
|
params.sourceType = SOURCE_TYPES
|
|
} else {
|
|
for (let i = 0; i < length; i++) {
|
|
if (typeof sourceType[i] !== 'string' || !~SOURCE_TYPES.indexOf(sourceType[i])) {
|
|
params.sourceType = SOURCE_TYPES
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|