diff --git a/src/components/LandMarkShow.vue b/src/components/LandMarkShow.vue index a780330..014e966 100644 --- a/src/components/LandMarkShow.vue +++ b/src/components/LandMarkShow.vue @@ -49,20 +49,14 @@ const judgmentDown = ref("dispaly:none;"); const adaptive = (imgId) => { let newImg; - let describesBox; - let brieflyBox; setTimeout(() => { newImg = document.getElementById(imgId); - describesBox = document.getElementById("describesBox"); - brieflyBox = document.getElementById("brieflyBox"); }, 5); setTimeout(() => { let newWidth = window.getComputedStyle(newImg, null)["width"]; let newMargin = window.getComputedStyle(newImg, null).marginLeft; - describesBox.style.width = newWidth; - describesBox.style.left = newMargin; - brieflyBox.style.width = newWidth; - brieflyBox.style.left = newMargin; + describesShow.value = `width:${newWidth};left:${newMargin};${judgmentDown.value}`; + brieflyShow.value = `width:${newWidth};left:${newMargin};${judgmentUp.value}`; }, 10); } @@ -73,24 +67,18 @@ watch(() => LandMarkShow.boxShow, (newValue, oldValue) => { watch(() => LandMarkShow.information.landImgUrl, (newValue, oldValue) => { nowId.value = 1; nowImg.value = `${LandMarkShow.information.landImgUrl}${nowId.value}.jpg`; - describesShow.value = "display:none;"; - brieflyShow.value = "display:block;"; judgmentUp.value = "display:block;"; judgmentDown.value = "display:none;"; adaptive(nowId.value); }) const up = () => { - describesShow.value = "display:block;"; - brieflyShow.value = "display:none;"; judgmentUp.value = "display:none;"; judgmentDown.value = "display:block;"; adaptive(nowId.value); } const down = () => { - describesShow.value = "display:none;"; - brieflyShow.value = "display:block;"; judgmentUp.value = "display:block;"; judgmentDown.value = "display:none;"; adaptive(nowId.value);