You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exportdefault{defaults(){return{list: []}fetchList(ctx){// 这里网络请求获取到数据并setSatate 到 list 中ctx.setState({list: ['a','b','c']})}getList(ctx){// PageB 页面调用此函数,获取到的 list 是个空数组constlist=ctx.getState().listconsole.log('list',list)// list 是空的数据}}
Uh oh!
There was an error while loading. Please reload this page.
logincA.js
PageA.js
import logicA from './logicA'
PageA 获取到数据后,然后跳转到 PageB 页面
PageB.js
import logicA from './logicA'
PageB 页面中如何在调用的时候依然能通过 ctx.getState() 拿到 list 当中的数据?
The text was updated successfully, but these errors were encountered: