Coder Social home page Coder Social logo

Comments (5)

dntzhang avatar dntzhang commented on May 20, 2024 1

1.你可以先new 出来再import到 各个store

2.westore 没有斩断 store 之间的通讯吧,这个可以开发者自己组织依赖关系、发布订阅什么的。

model之间可以多对多互相依赖,store之间可以多对多互相依赖,model和store之间可以多对多互相依赖。

westore只是斩断model和view之间的依赖。

from westore.

nanhupatar avatar nanhupatar commented on May 20, 2024

@dntzhang

from westore.

nanhupatar avatar nanhupatar commented on May 20, 2024

目前解决方案 ,可以实现多个页面绑定同一store,暂不清楚有什么弊端
onShow() {
this.setData({ ...Store.data }, () => {
Store.bind('page', this);
});
},

from westore.

Megasu avatar Megasu commented on May 20, 2024

请问官方能出多个页面共享一个 store 例子吗?

现在官方的 example 只是在一个页面中用到 store,这样的 store 抽离在单个页面中使用感觉是非必须的。
但 原生小程序的多个页面共享一个 store 的需求应该更常见,多页面共享用户信息,共享购物车数量等。

所以冒昧问一下,官方是否有计划出品类似 pinia , vuex 这类全局状态管理库,方便使用原生小程序的开发者使用。🌹🌹

from westore.

wuhao1477 avatar wuhao1477 commented on May 20, 2024

请问官方能出多个页面共享一个商店的例子吗?

现在官方的例子只是在一个页面中可用存储,这样的存储抽离在单个页面中使用感觉是非必须的。 但初期小程序的多个页面共享一个存储的需求应该更常见,多页面共享用户信息,共享购物车数量等。

所以冒昧问一下,官方是否有计划出品类似 pinia , vuex 这类全局状态管理库,方便使用简单小程序的开发者使用。🌹🌹

请问一下“多页面共享用户信息,共享购物车数量”等需求的话目前您的解决方案用的是什么呢?

from westore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.