ts 开发的 Page data是有值的 在模板可以显示出值 this.data.xxx 拿不到?
是用了 mobx-miniprogram-bindings
在Page 中这么写的
Page({
data: <any>{
days: <any>[],
day: <any>null,
tabIndex: <any>0,
rangeIndex: <any>0,
isRangeSelected: false
},
onLoad(options?) {
this.setMobxBindings();
},
setMobxBindings() {
this.storeBindings = createStoreBindings(this, {
store,
fields: ['library'],
actions: ['setAppointmentSuccess'],
})
},
onUnload() {
this.storeBindings.destroyStoreBindings()
},
onShow() {
console.log(this.data)
console.log(this.data.library)
// this.getDays();
},
})