MCPcopy
hub / github.com/Bistutu/FluentRead / unmountSelectionTranslator

Function unmountSelectionTranslator

entrypoints/utils/selectionTranslator.ts:35–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33 * 卸载选词翻译组件
34 */
35export function unmountSelectionTranslator() {
36 if (selectionTranslatorInstance && app) {
37 // 获取容器
38 const container = document.getElementById('fluent-read-selection-translator-container');
39
40 // 卸载Vue应用
41 app.unmount();
42 selectionTranslatorInstance = null;
43 app = null;
44
45 // 移除容器
46 if (container) {
47 container.remove();
48 }
49 }
50}
51
52/**
53 * 切换选词翻译组件的启用状态

Callers 2

mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected