You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe alternatives you've considered
目前为了共享view函数与view事件的上下文,我在调用view函数时,会往viewer实例上赋值一个viewTriggerContext对象,收到view事件后,从viewer实例取回并删除viewTriggerContext对象,这样显然相当不优雅。hide函数与hide事件之间共享上下文也是同理。
Additional context
无
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
可行的建议方案:
在view, viewed, hide, hidden事件的event对象中加入一个"triggeredBy"字段,
例如:
当事件是由用户主动点击触发时,
event.triggeredBy = 'actively_user_action'
当事件是由编程式的函数调用触发时,
event.triggeredBy = 'programmed_call'
view()、hide()函数加入一个triggerContext参数,赋值到事件的event对象上,
例如:
当调用viewer打开了一个图片,参数triggerContext传入了一个上下文对象,
然后产生的view事件的event.triggerContext能够访问到这个上下问对象。
Describe alternatives you've considered
目前为了共享view函数与view事件的上下文,我在调用view函数时,会往viewer实例上赋值一个viewTriggerContext对象,收到view事件后,从viewer实例取回并删除viewTriggerContext对象,这样显然相当不优雅。hide函数与hide事件之间共享上下文也是同理。
Additional context
无
The text was updated successfully, but these errors were encountered: