Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set字符串形式的会带有引号 #2

Open
lxyc opened this issue Dec 26, 2018 · 2 comments
Open

set字符串形式的会带有引号 #2

lxyc opened this issue Dec 26, 2018 · 2 comments

Comments

@lxyc
Copy link

lxyc commented Dec 26, 2018

场景:多项目共用storage,有些引插件,有些原生写法
问题:set字符串形式的会带有引号,不能使用原生localStorage.getItem获取

function serialize(val) {
  return typeof val === 'string' ? val : JSON.stringify(val);
}
@lemonW
Copy link

lemonW commented Jan 5, 2021

这个问题是不打算修复了吗?

@justforuse
Copy link

感觉这个包就是为了方便处理对象类型的数据存储与获取吧,当然也可以处理基本数据类型。没考虑兼容性(或者说没必要)

如果要兼容的话可以自己实现啊,都是localStorage的api调用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants