智能照明系统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/b6/b680de8ce4a1b1dc7497fbae3fe...

21 lines
511 B

const deprecated = {
events: {
tap: 'click',
longtap: 'longpress'
}
}
module.exports = function parseEvent (el) {
if (el.events) {
const {
events: eventsMap
} = deprecated
Object.keys(el.events).forEach(name => {
// 过时事件类型转换
if (eventsMap[name]) {
el.events[eventsMap[name]] = el.events[name]
delete el.events[name]
// warnLogs.add(`警告:事件${name}已过时,推荐使用${eventsMap[name]}代替`)
}
})
}
}