智能照明系统APP-本地串口
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.
 
 
 
 
 
 
LightingSystemApp-serial/.svn/pristine/d8/d8fc2a316bcebc4e7456de4821b...

37 lines
894 B

import {
isFn
} from 'uni-shared'
const mpBehaviors = {
'wx://form-field': {},
'wx://component-export': {}
}
function callDefinitionFilter (mpComponentOptions) {
const {
behaviors,
definitionFilter
} = mpComponentOptions
const behaviorDefinitionFilters = []
if (Array.isArray(behaviors)) {
behaviors.forEach(behavior => {
behavior = typeof behavior === 'string' ? mpBehaviors[behavior] : behavior
if (behavior.definitionFilter) {
behaviorDefinitionFilters.push(behavior.definitionFilter)
behavior.definitionFilter.call(null, mpComponentOptions, [])
}
})
}
if (isFn(definitionFilter)) {
return function (defFields) {
definitionFilter(defFields, behaviorDefinitionFilters)
}
}
}
export function parseDefinitionFilter (mpComponentOptions, vueComponentOptions) {
callDefinitionFilter(mpComponentOptions)
}