微信小程序android拿不到数据,微信小程序奇怪问题,数据获取不到

1.微信小程序通过app.json去add page,其中pages中已添加"pages/monthDetail/index"页面,并且能从首页访问到该页面,静态页面完全OK。下一步上模拟数据。

2.通过以下数据来模拟真实数据,其中js中无其他ES6语法,此时,页面console提示

`

data: {

yearList: [{

year: '2016',

totalIncome:'2016',

monthList: [{

month: '04',

income: 233,

cost: 23,

},{

month: '06',

income: 232,

cost:23,

}]

},{

year: '2015',

totalIncome:'2016',

monthList: [{

month: '12',

income: 2323,

cost: 111

}]

}]

},

`

此时,页面console提示错误:

Page[pages/monthDetail/index] not found. May be caused by: 1. Forgot to add page route in app.json. 2. Invoking Page() in async task.

但是明明app.json里面已经添加过该页面,并且能访问得到,只是数据拿不到。app.json如下

{

"pages":[

"pages/index/index",

"pages/logs/logs",

"pages/monthDetail/index"

],

"window":{

"backgroundTextStyle":"light",

"navigationBarBackgroundColor": "#25282e",

"navigationBarTitleText": "微信小程序",

"navigationBarTextStyle":"#fff",

"enablePullDownRefresh": true

}

}

在wxml中代码如下:

{{ item.year }}

收:{{ item.totalIncome }}

支:{{ item.totalCost }}

{{ item.totalIncome - item.totalCost }}

结余

{{ items.month }}

收:{{ items.income }}

支:{{ items.cost }}

{{ items.income - items.cost }}

结余

3.有一起研究小程序的同伴大神遇到过这样的问题吗?

补充提问:

有看到大神遇到这样的情况,说是在app.json中二级页面的定义要在一级页面的下面。此方法也修改了,不报之前的console错误,但是数据依旧无法正常显示。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值