【update】-大屏修改锚点的实现方式
This commit is contained in:
@@ -9,7 +9,8 @@
|
|||||||
v-for="item in menuData"
|
v-for="item in menuData"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
>
|
>
|
||||||
<a :href="'#' + item.href">{{ item.name }}</a>
|
<!--<a :href="'#' + item.href" :key="item.href">{{ item.name }}</a>-->
|
||||||
|
<div @click="locationDom(item)">{{ item.name }}</div>
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
</a-menu>
|
</a-menu>
|
||||||
</template>
|
</template>
|
||||||
@@ -165,6 +166,11 @@ export default {
|
|||||||
path: '/screen',
|
path: '/screen',
|
||||||
})
|
})
|
||||||
window.open(routerUrl.href, '_blank')
|
window.open(routerUrl.href, '_blank')
|
||||||
|
},
|
||||||
|
locationDom(item) {
|
||||||
|
document.querySelector(`#${item.href}`).scrollIntoView({
|
||||||
|
behavior: 'smooth'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user