* 绑定窗口事件
()
| 1125 | * 绑定窗口事件 |
| 1126 | */ |
| 1127 | bindWindowEvents() { |
| 1128 | on(window, 'hashchange', () => { |
| 1129 | const newKey = location.hash.slice(1).trim() || this.config.DEFAULT_BOOK_KEY; |
| 1130 | if (newKey === this.state.bookKey) return; |
| 1131 | this.applyBookChange(newKey).then(() => this.loadUnitFromStorage()); |
| 1132 | }); |
| 1133 | } |
| 1134 | |
| 1135 | // ========================================================================= |
| 1136 | // 清理和销毁 |
no test coverage detected