Closed pharaoh2012 closed 1 year ago
事件文档有错误,都缺少事件名称参数。例如window.focused事件,文档内容如下:
Niva.addEventListener("window.focused", (focused: boolean) => { // do somethings... console.info({focused}) });
显示结果为: {focused: 'window.focused'} 实际第一个参数都是事件名称,修改代码为:
{focused: 'window.focused'}
Niva.addEventListener("window.focused", (eventName:string, focused: boolean) => { // do somethings... console.info({eventName,focused}) });
显示结果为: {eventName: 'window.focused',focused:true}
{eventName: 'window.focused',focused:true}
其他的事件函数是一样的。
The issue has already been resolved. https://bramblex.github.io/niva/docs/event
事件文档有错误,都缺少事件名称参数。例如window.focused事件,文档内容如下:
显示结果为:
{focused: 'window.focused'}
实际第一个参数都是事件名称,修改代码为:显示结果为:
{eventName: 'window.focused',focused:true}
其他的事件函数是一样的。