import * as VLog from "../utils/log" ; /**
 * 本 Behavior 会在小程序 methods 中每个方法调用前添加一个 Log 说明
 * 需要在 Component 的 data 属性中添加 PAGE_NAME，用于描述当前页面
 */ export default Behavior ( { lifetimes : { attached ( ) { } } , definitionFilter ( defFields ) { Object . keys ( defFields . methods || { } ) . forEach ( methodName => { const originMethod = defFields . methods ! [ methodName ] ; defFields . methods ! [ methodName ] = function ( ev , ... args ) { if ( ev && ev . target && ev . currentTarget && ev . currentTarget . dataset ) { VLog . RUN ( defFields . data ! . PAGE_NAME , `${ methodName } invoke, event dataset = ` , ev . currentTarget . dataset , "params = " , ... args ) ; } else { VLog . RUN ( defFields . data ! . PAGE_NAME , `${ methodName } invoke, params = ` , ev , ... args ) ; } return originMethod . call ( this , ev , ... args ) ; } ; } ) ; } } ) ;