入门 ,我就当你已经看过了哈!
讲真,都是干货,你可以湿润哈,也就是用IDE自己试一下。
之前大概了解到一个完整的微信小程序是什么样子。之后就是我们作为用户看到的多彩的页面是怎么来的,也就是视图与渲染的部分。
这里,我们首先有一个完美的假设:假设我们在页面上需要展示 msg 中的内容给用户看,但是不同的用户可能数据不同。基于这样的一个场景,我们需要做以下工作来完整这个需求,让产品经理闭上嘴。
首先是页面,也就是 wxml 文件:

然后就是 pageName.js 文件:

页面初始化赋值,还会有函数触发赋值:

Then,that’s all,thank you。
网友评论