Giter VIP home page Giter VIP logo

Comments (5)

zwmmm avatar zwmmm commented on July 21, 2024

最终返回的值是

{
    data: {
        a: {
            numa: 1,
            numb: 2
        },
        b: {
            numc: 3,
            numd: 4
        }
    },
    getA() {
        console.log('a');
    },
    getB() {
        console.log('b');
    }
}

from westore.

dntzhang avatar dntzhang commented on July 21, 2024

赞,不错~

from westore.

bili-jing avatar bili-jing commented on July 21, 2024

update的时候key应该怎么样呢
image
请问如何更新到roomStore里面的数据呢.
image
然后wxml里面该如何绑定数据。我试了roomStore.xxx不行.直接xxx也不行呢.
image

from westore.

zwmmm avatar zwmmm commented on July 21, 2024

update的时候key应该怎么样呢
image
请问如何更新到roomStore里面的数据呢.
image
然后wxml里面该如何绑定数据。我试了roomStore.xxx不行.直接xxx也不行呢.
image

仔细看下readme
第一个问题 数据更新 使用

this.store.data.a = 'a'
this.update()

在wxml中使用的数据需要现在page的data中声明(但是默认值要在store中设置)

{
  data: {
     a: null
  },
  onload() {
    this.store.data.a = 'a'
    this.update()
 }
}
<div>{{ a }}</div>

from westore.

bili-jing avatar bili-jing commented on July 21, 2024

@zwmmm 谢谢老哥。情况是
{
data: {
a: {
numa: 1,
numb: 2
},
b: {
numc: 3,
numd: 4
}
},
getA() {
console.log('a');
},
getB() {
console.log('b');
}
}
a-page对应的data也应该是
a: {
numa: 1,
numb: 2
},
是么.
然后wxml绑定即{{a.numa1}}

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.