From 952dc9ca57f1f1ef09f0151368d70edb9b031384 Mon Sep 17 00:00:00 2001 From: zhangyao Date: Fri, 16 Jun 2023 09:38:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=BB=8F=E8=BF=87?= =?UTF-8?q?=E5=BA=97=E9=93=BA=E6=BB=9A=E5=8A=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PathGroup/PathGroup.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/PathGroup/PathGroup.vue b/src/components/PathGroup/PathGroup.vue index a7593d3..ec1b6c1 100644 --- a/src/components/PathGroup/PathGroup.vue +++ b/src/components/PathGroup/PathGroup.vue @@ -16,7 +16,7 @@ {{ yourpos }} -
  • +
  • @@ -92,12 +92,17 @@ function onPathPlayOver() { playIdx.value = props.pathshop.length } +const scroll = ref() + function onPathPlaying(e: any) { // console.log(e.data) //返回小人位置 {"pathArrIn": 0, "pathIndex": 1, "shopNum":"" } const { shopNum } = e.data if (shopNum) { const idx2 = props.pathshop.findIndex((val: any) => val.shopNum === shopNum) playIdx.value = idx2 + if (scroll.value && document.getElementById(shopNum)) { + scroll.value.scrollToElement(document.getElementById(shopNum)) + } } } //重置playIdx @@ -123,6 +128,7 @@ const yourpos = computed(() => { const lastImage = computed(() => { return shop.value.logoUrl ?? require('@/assets/images/header/logo.svg') }) + defineExpose({ resetPlayIdx })