推进 INI 面板 launcher link view-model helper
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user