()
| 199 | * 卸载悬浮球 |
| 200 | */ |
| 201 | export function unmountFloatingBall() { |
| 202 | if (floatingBallInstance && app) { |
| 203 | // 移除事件监听 |
| 204 | document.removeEventListener('fluentread-toggle-translation', toggleFloatingBallTranslation); |
| 205 | |
| 206 | // 获取容器 |
| 207 | const container = document.getElementById('fluent-read-floating-ball-container'); |
| 208 | |
| 209 | // 卸载 Vue 应用 |
| 210 | app.unmount(); |
| 211 | floatingBallInstance = null; |
| 212 | app = null; |
| 213 | |
| 214 | // 移除容器 |
| 215 | if (container) { |
| 216 | container.remove(); |
| 217 | } |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | /** |
| 222 | * 切换悬浮球可见性 |
no outgoing calls
no test coverage detected