Some conclusions and understanding of the war against the applet

Closed stop learning, against the war!

Rendering a list of applets
1, wx: for a binding property of the control array, the array of data used to render
2, wx: for-item variable name designated current element array
3, wx: for-index of the current element of the specified array subscript

Conditions rendering applet
1, determines whether the current rendering binding assembly according to the logic shown in the expression.
2, wx: if: Use wx: if = "{{content }}" to determine whether the rendering code:

<view wx:if="{{condition}}">True</view>

It can also be used wx: elif and wx: else:

<view wx:if="{{num> 60}}">及格</view>
<view wx:elif="{{num> 90}}">优秀</view>

Two small program wxs wording
1, can be written in the wxml

  <wxs module="aaa"> </wxs>

2, in .wxs file

<wxs src="./wxs/demo.wxs" module="aaa" />

Component applet by value
1, a parent component to add custom attribute value of the attribute value is transmitted to the sub-assembly, if the value of the property is variable, Boolean, data, use double braces.
2, the subassembly defined place, add a properties option, the option value of properties is an object
attribute key is a custom name, value by value of this type of data can be custom property name to access the data in the component

Some life cycle applet
1, first open the applet, it will trigger onLauch (triggers only once);
2, after initialization is complete, the trigger onShow method, monitor display;
3, from the foreground into the background, triggering onHide methods;
4, from back into the front display, triggering onShow method;
5, running in the background a certain time, or system resources is too high, it will be destroyed;

1, the page is loaded, triggering onLoad method, a page will only be called once;
2, after the page has loaded trigger onShow method, display pages, every time you open the page will be called once;
3, the first display page will trigger onReady method to render the page and style, a page will only be called once;
4, when running in the background or jump to other pages, triggering onHide method;
5, into the foreground from the background or reload the page, triggering onShow method;
6, or when readirectTo Close this page to return navigateBack, triggering onUnload

Some uniapp life cycle
1, onLoad monitor page loads, the parameter data transmitted on pages
2, object parameter passing for page
3, onShow page display monitor
4, onReady initial page rendering is complete monitor
5, onHide monitor hidden page
6, onUnload listening to uninstall page
7, onPullDownRefresh drop-down monitor user actions
8, an event handler to pull bottoming onReachBottom on page
9, onShareAppMessage user clicks the Share the upper right corner
10, onPageScroll monitor page scroll
11, onTabItemTap current is tab page, click on the tab trigger

1, the trigger (the global one-shot) when onLaunch initialization is complete
2, onShow start, or from the background into the foreground display
3, onHide from the foreground into the background trigger
4, onUniNViewMessage nvue page of data sent by listeners

vue life cycle
1, beforeCreate HTML is not loaded, the model did not initialize
2, created HTML is not loaded, the model has been initialized,
3, beforeMount HTML load, unresolved, unmounted, related render function is called for the first time.
4, mounted HTML loaded, parsed, vm el newly created. $ El replaced, and mount the hook to call up after instance.
5, call beforeUpdate updating data, it occurs before the virtual re-DOM rendering.
6, updated when the hook is called, DOM component has been updated, can execute an operation dependent on the DOM.
7, before calling beforeDestroy instance destroyed. In this step, the instance is still fully available.
8, destroyed Vue instance called after the destruction. After the call, everything will de-Vue tied instance, all event listeners will be removed, all the child instance will be destroyed.

Published an original article · won praise 0 · Views 10

Guess you like

Origin blog.csdn.net/qq_45429529/article/details/104461556