bramblex / niva

一个基于 Tauri WRY 跨端 Webview 库的超轻量极易用的跨端应用开发框架。
https://bramblex.github.io/niva/
MIT License
644 stars 35 forks source link

事件文档有错误,都缺少事件名称参数。 #26

Closed pharaoh2012 closed 1 year ago

pharaoh2012 commented 1 year ago

事件文档有错误,都缺少事件名称参数。例如window.focused事件,文档内容如下:

Niva.addEventListener("window.focused", (focused: boolean) => {
  // do somethings...
  console.info({focused})
});

显示结果为: {focused: 'window.focused'} 实际第一个参数都是事件名称,修改代码为:

Niva.addEventListener("window.focused", (eventName:string, focused: boolean) => {
  // do somethings...
  console.info({eventName,focused})
});

显示结果为: {eventName: 'window.focused',focused:true}

其他的事件函数是一样的。

bramblex commented 1 year ago

The issue has already been resolved. https://bramblex.github.io/niva/docs/event