AI助手支持GPT4.0
页面的wx:for 如何引用 data内的其他变量?How does the page's wx:for reference other variables in data?
页面的wx:for 如何引用 data内的其他变量?
js数据:
data:{
myArray:[1,2,3],
otherData:xxx
}
页面:
《view wx:for={{myArray}} ..... 》
{{otherData}} //作用域的问题,这里得不到数据 ,2年前我解决过一次,前面加个语法类似 {{parent.otherData}} 但具体忘记了。高人给偶老年痴呆一个语法呗? 补充:也可能我记忆错位了。解决过其他前端框架类似问题。而不是微信小程序的。
还能编辑吗?呃,问题有变化,是我在页面得不到Data内定义为Map集合的数据。。。。打扰了各位。。。
《/view》
JS data: data: {myArray: [1,2,3], otherData:xxx }Page: View Wx: for = {myArray}}}} / / scope problem, no data is available here. I solved it once two years ago, and added a syntax similar to it{{ parent.otherData }}But I forgot. Senior people give me a grammar for Alzheimer's disease? Add: Maybe my memory is misplaced. Solved similar problems in other front-end frameworks. Not wechat applet. Can you edit it? Er, the problem has changed. I can't get the data defined as the map set in the data on the page.... Excuse me... 《/view》
直接 {{ otherData }} 就行
请学会如何「提问」(👈戳我)、【个体工商户】微信认证问题(👈戳我)