I have some problem about returning to same scroll position between pages. The thing is I am iterating a data
<template>
<router-link class="type-atag" v-for="item in types" :key="item.id" :to="{name:'plan_detail', params:{pid:item.id}}">
<ul class="flex align-ver align-hor column type-btn">
<li class="btn-item">{{item.kind}} <span>{{item.menu}}</span></li>
<li class="btn-item">{{item.type}}</li>
</ul>
</router-link>
</template>
User going into the detail page of clicked id. Then coming back to the main frame, again. But as you would, I don't want to show the top of the page again. So I tried to use vue-router's scrollBehavior()
but there is a hash
issue. Because I can't give #id
of iterated data...
What is the best way to solve this problem? For example is there a way that I can scroll to item.id
item.id
@NgocTuanLam – yvl