Based react nativeresponsive development framework, component-based development, a data driver
Divided into view layer and logic layer, data changes, logic will also change
Data binding, through interpolation expressions,{
{}}
Conditional rendering,wx:if、wx:elif、wx:else
List rendering wx:for, and needs time to traverse wx:key, if necessary change the name, double loop inside the loop to get out of the loop, as modified item, compared wx:for-item="user", modify index, compared withwx:for-index="idx"
<!--pages/test/test.wxml--><textwx:if="{
{ show }}">
{
{ msg }}
{
{ list }}
</text><viewwx:for="{
{ list }}"wx:key="{
{ index}}">
{
{ item }} {
{ index }}
</view><viewwx:for="{
{ list2 }}"wx:key="{
{index}}"wx:for-item="user"wx:for-index="{
{idx}}">
{
{user.name}} {
{ user.city}} {
{ idx }}
<viewwx:for="{
{ user.course }}"wx:key="{
{ index }}">
{
{ item}} {
{ index }}
</view></view>
Fourth, the page configuration of the applet
dataIt is the initial data used for the first rendering of the page. When the page is loaded, datait will be in JSONthe form of a string passed to the rendering by the logical layer level, and therefore datathe data must be transformed into JSONtypes: string, number, Boolean, object array.
Life cycle function
onLoad(Object query) Triggered when the page loads, only called once
onShow() Triggered when the page is displayed/cut to the foreground
onReady() Triggered when the first rendering of the page is completed, a page will only be called once, which means that the page is ready to interact with the view layer
onHide() Triggered when the page is hidden/cut into the background
onUnload() Triggered when the page is unloaded
Page event handler
onPullDownRefresh() Monitor user pull-down refresh events
onReachBottom() Monitor user pull-up bottoming event
onPageScroll(Object object) Monitor user sliding page events
onShareAppMessage(Object object) Monitor the user's click on the forward button on the page (button component open-type="share") or the "forward" button in the upper right corner menu, and customize the forwarding content
onResize(Object object) Triggered when the applet screen is rotated
onTabItemTap(Object object) Triggered when tab is clicked
Five, the global configuration of the applet
Global Configuration applet into pagesthe page path list, windowthe global default window performance, tabBarthe bottom of the tabperformance bar, networkTimeoutnetwork time-out and debugopen debugmode and so many