推进 INI 面板 launcher link view-model helper

This commit is contained in:
2026-06-15 04:25:29 +08:00
parent ac463453da
commit b330f7b1bc
7 changed files with 200 additions and 16 deletions

View File

@@ -73,16 +73,16 @@
</section>
</main>
<script type="module">
import { getIniPanelEntryManifest } from "./ui-shell.js";
import { createIniPanelLauncherLinkViewModel } from "./ui-shell.js";
const manifest = getIniPanelEntryManifest();
for (const entry of manifest) {
const link = document.querySelector(`a[data-entry-id="${entry.id}"]`);
const links = createIniPanelLauncherLinkViewModel();
for (const linkModel of links) {
const link = document.querySelector(`a[data-entry-id="${linkModel.entryId}"]`);
if (!link) {
throw new Error(`Missing launcher entry ${entry.id}`);
throw new Error(`Missing launcher entry ${linkModel.entryId}`);
}
link.textContent = entry.title;
link.href = entry.href;
link.textContent = linkModel.label;
link.href = linkModel.href;
}
</script>
</body>