简体   繁体   中英

Vue JS 2. How to prevent reload same nested component when navigate between two parent?

I have Menu component, that is nested in two different layouts. When I navigate between these two parent component, Vue reloads nested component every time. It cause a problem: Menu's scroll position goes to 0:0 when page is reload. I tried to use, but it didn't work.

How can I prevent same nested component reloading when switching between two parents?

It seems you are using the same store/data options in two different layouts. Try to save your data in the parents components and only pass it to your menu via props.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM