如数据对象:
ruleForm: {
name: '', password:'',},
使用localStorage
localStorage.setItem("person", JSON.stringify(this.ruleForm));
取值
localStorage.getItem("person")
如果不将对象转换为string类型,在取值的时候就只会取到类似[Object, Object]的东西。
Powered by: 博客园 Copyright © 2024 XLouis Powered by .NET 9.0 on Kubernetes