Files
Starlight_Lancher/tools/icon_work/fix_tooltip.py
Ap_Tx e53c0bf1fd
Some checks failed
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled
fix:关于页 tooltip 残留
2026-09-13 18:40:47 +08:00

18 lines
1013 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

p = r"D:\Project\Starlight_Lancher\apps\app-frontend\src\App.vue"
t = open(p, encoding="utf-8").read()
# 1) 加 import放在 App.vue 的 import 区,紧跟其他 @ 包;找一个锚点)
anchor = "import { listen } from '@tauri-apps/api/event'"
assert anchor in t, "找不到 anchor import"
t = t.replace(anchor, "import { hideAllPoppers } from 'floating-vue'\n" + anchor, 1)
# 2) router.afterEach 开头加 hideAllPoppers()
old = "router.afterEach((to, from, failure) => {\n\tif (!failure) void invoke('lightweight_mode_set_route', { route: to.fullPath })"
new = "router.afterEach((to, from, failure) => {\n\thideAllPoppers()\n\tif (!failure) void invoke('lightweight_mode_set_route', { route: to.fullPath })"
assert old in t, "找不到 router.afterEach 开头"
t = t.replace(old, new, 1)
open(p, "w", encoding="utf-8", newline="\n").write(t)
print("done")
print(" 含 hideAllPoppers import:", "import { hideAllPoppers } from 'floating-vue'" in t)
print(" 调用次数:", t.count("hideAllPoppers()"))