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

请问一个页面如何引用多个store的data #138

Open
kxbin opened this issue May 17, 2022 · 2 comments
Open

请问一个页面如何引用多个store的data #138

kxbin opened this issue May 17, 2022 · 2 comments

Comments

@kxbin
Copy link

kxbin commented May 17, 2022

例如:

import store1 from 'stores/store1'
import store2 from 'stores/store2'

Page({
  data: {
    d1: store1.data,
    d2: store2.data,
  }

  onLoad() {
    store1.bind(this)
    store2.bind(this)
  },
})
@LTRltr
Copy link

LTRltr commented Mar 8, 2024

https://github.com/linjc/mini-stores
这个小程序的状态管理,可以这么用,示例在下面
https://github.com/linjc/mini-stores/blob/master/examples/wx/pages/index/index.js

@dntzhang
Copy link
Collaborator

dntzhang commented Dec 8, 2024

https://github.com/Tencent/westore/blob/master/packages/westore-example/stores/home-store.js

一个页面只有一个store,但是可以有多个 model

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