Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nw-chat 最佳实践/常见问题 汇集 #1

Open
fritx opened this issue Feb 19, 2016 · 1 comment
Open

nw-chat 最佳实践/常见问题 汇集 #1

fritx opened this issue Feb 19, 2016 · 1 comment

Comments

@fritx
Copy link
Member

fritx commented Feb 19, 2016

最佳实践

  • win关闭时 其附属变量全部回收 如新开窗口传入callback等 需注意调用位置 否则变为zombie
  • alert等popup由main弹出 避免出现窗口关闭 刚好loaded传值被中断
  • mac上drag/nodrag区域 生效不及时 需触发blur/focus
  • show_in_taskbar:false导致连带dock图标消失 mac上不应使用
  • popup/profile entry拆分
  • login/home 为常驻
  • OSX frameless win title visible v0.13.0 Beta5 - transparency on OSX - win title/name still shows with frames false. nwjs/nw.js#4339 note
  • win.x/y width/height 必须传入整数 否则无作用
  • 记得捕获Cmd-W 关闭窗口 普通keydown事件即可
  • callback/reject new Error() 可以追踪stack
  • 从qq粘贴图片 某些本地URL在decodeURIComponent报错 需要容错 file:///C:\Users\fritz.lin\AppData\Local\Temp\5{0MO)%QR2R67J[G~8NZ1]O.jpg
  • win上的事件绑定在entry启动时 统一清除 解决刷新问题
  • openWindow时直接设定always-on-top 会导致win就绪前自动show 需要转移到就绪时 win.setAlwaysOnTop()
  • display:inline-block 可以优化(精确)选中区域
  • 普通form一定要禁止默认submit行为 否则重复提交会导致 Error: Element already exists 崩溃
  • 关闭窗口 不要直接调.close(true) 只能调.close() 以免错失默认行为
  • react中 零散的文本会被自动包裹为span css中务必不要简单地选择span dom中也尽量用其他标签替换 搜索^\s*span\s*\{
  • mac nodrag不起效的问题 注意nodrag区域必须占位才有效
  • nw窗口关闭时 window及附带变量会提前置为null
  • nw与redux结合使用 关闭窗口时 需要触发一次componentWillUnmount 使react-redux解绑

常见问题

部分笔记

https://github.com/fritx/secret/issues/9
http://blog.fritx.me/?weekly/

@fritx
Copy link
Member Author

fritx commented Jun 13, 2016

image

(错觉 -- 白色显得膨胀)


[0329] 截图弹窗+插入逻辑仿QQ 列表格说明
[0329] Mac新窗口关闭 父窗口自动focus bug (影响截图新插入逻辑的成立) mWin.focus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant