单击 Vue 中的“关于"页面后,我丢失了数据 [英] I'm losing data after clicking on About page in Vue
本文介绍了单击 Vue 中的“关于"页面后,我丢失了数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我安装了一个 Vue 路由器和两个页面:Home
和 About
.一切正常,但是当我点击 About
页面然后返回时,来自 Home
页面的数据消失了.页面没有重新加载,我只是在路由页面之间移动.道具被传递给组件.哪里出错了?为什么点击About
页面后数据没有保存在组件中?
I have a Vue router installed and two pages: Home
and About
.
All is working, but when I click to About
page and then back, data from Home
page is gone. Page not reloading, I'm just moving between routed pages. Props are passed to the component.
Where is a mistake? Why data doesn't save in component after clicking About
page?
推荐答案
这个问题已经解决了.使用了 Vuex
.
This problem has been solved. Vuex
was used.
这篇关于单击 Vue 中的“关于"页面后,我丢失了数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文