视图 |如何在页面之间存储隐私信息?

Vue | How to store private information between pages?

我在 'form' 页面上有一个包含 6 个问题的表格。我在切换问题后将输入值添加到 userData 对象。在表单的末尾,我将 userData 发送到 firebase。

但是当我切换页面时,userData 对象被清除。

如何在页面之间存储userData?我不想使用 localStorage 因为它不安全。

您可以使用 Vuex.

Vuex is a state management pattern + library for Vue.js applications. It serves as a centralized store for all the components in an application, with rules ensuring that the state can only be mutated in a predictable fashion.