增加input 代理事件

增加input 代理事件
This commit is contained in:
穷屌丝 2019-10-10 11:55:51 +08:00 committed by GitHub
parent 071089928c
commit 53a191a11f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 1 deletions

View File

@ -28,4 +28,23 @@ export function fixProps(properties){
}
}
return props
}
}
// 代理input
export function helpInputEvent(fn, e){
if(!e.detail){
Object.defineProperty(e,'detail',{
value: {},
writable: false,
configurable : true
});
}
Object.defineProperty(e.detail,'value',{
value: e.target.value,
writable: false,
configurable : true
});
fn && fn(e)
}