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

「疑问」请问 Taro 的 Storage 在小程序间共享嘛 #13922

Closed
wenfangdu opened this issue May 29, 2023 · 1 comment
Closed

「疑问」请问 Taro 的 Storage 在小程序间共享嘛 #13922

wenfangdu opened this issue May 29, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@wenfangdu
Copy link
Contributor

比如我在 A 小程序设置了:

Taro.setStorage({
  key: 'foo',
  data: 'bar',
})

B 小程序通过以下代码可以拿到 foo 的值嘛?

Taro.getStorage({
  key: 'foo',
  success(res) {
    console.log(res.data)
  },
})
@taro-bot2 taro-bot2 bot added the enhancement New feature or request label May 29, 2023
@TheKonka
Copy link
Member

这个跟 taro 没关系, taro 只是帮你调用微信的api , 这就涉及到微信小程序自己的机制问题了。
https://developers.weixin.qq.com/miniprogram/dev/framework/ability/storage.html
image
根据微信小程序官方文档,可以得出结论是不共享的

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

No branches or pull requests

2 participants