Skip to content

Commit

Permalink
组件私有数据测试
Browse files Browse the repository at this point in the history
  • Loading branch information
dntzhang committed Oct 30, 2018
1 parent 8c5b932 commit 8d9335c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/westore/components/hello/hello.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,20 @@ create({
*/
data: {
abc : '',
pureProp: ''
pureProp: '',
bbb: '组件私有数据'
},

ready: function () {
// this.store.onChange = function(info){
// console.log(info)
// }

// setTimeout(() => {
// this.store.data.abc = 'efg'
// this.update()
// }, 2000)
setTimeout(() => {
this.setData({
bbb:'使用 setData 修改组件私有数据'
})
}, 2000)
},
/**
* 组件的方法列表
Expand Down
3 changes: 3 additions & 0 deletions packages/westore/components/hello/hello.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
<view>
<text>【{{pureProp}}】 from Pure Component!</text>
</view>
<view>
<text>{{bbb}}</text>
</view>
</view>

0 comments on commit 8d9335c

Please sign in to comment.