画两张地图

This commit is contained in:
AncTe committed 2023-04-17 22:37:50 +08:00
1 parent 8faeeb9aca
commit 1e916be361
6 files changed
+100 -20

No files matched your search

+11 -2
View File
@@ -87,7 +87,7 @@ async function calHeight() {
if (core.plugin.fixedDetailOpened.value) {
showFixed.value = false;
}
main = document.getElementById('enemy-fixed') as HTMLDivElement;
updateMain();
if (!main) return;
const style = getComputedStyle(main);
const h = parseFloat(style.height);
@@ -106,10 +106,19 @@ function getLabel(attr: keyof DetailedEnemy) {
return core.getStatusLabel(attr);
}
function updateMain() {
main = document.getElementById('enemy-fixed') as HTMLDivElement;
if (main) {
main.addEventListener('mouseleave', () => {
showFixed.value = false;
});
}
}
onUpdated(calHeight);
onMounted(() => {
main = document.getElementById('enemy-fixed') as HTMLDivElement;
updateMain();
calHeight();
});
</script>