WXML (WeiXin Markup Language) is a set of tag languages designed by the framework. Combined with basic components and event systems, it can build the structure of the page.
I think WXML is introduced through three dimensions: vertical, horizontal, and logical processing. Here is a brief introduction. They are also the basis for developing small programs. You can use them according to the document when needed. The details will be introduced later. The function will be expanded when time comes.
Vertical
Vertical: That is, the combination of components, including: system components, third-party components, custom components.
For example:
<view> <view> <image></image> <text> 用户名 </text> </view> </view>
System components:
View container: cover-image, cover-view, movable-area, movable-view, scroll-view, swiper, swiper-item, view
Basic content: icon, progress, rich-text, text
Form components: button, checkbox, checkbox-group, editor, form , input, label, picker, picker-view, picker-view-column, radio, radio-group, slider, switch, textarea
Navigation: functional-page-navigator, navigator
Media components: audio, camera, image, live-player, live-pusher, video
Map: map
Canvas: canvas
- ##Open capabilities: ad, official-account, open-data, web-view
- Native Component description: native-component
- Accessibility: aria-component
- Navigation bar: navigation-bar
- Page attribute configuration node: page-meta
https://developers.weixin.qq.com/miniprogram/dev /component/native-component.html
: For example, WeUI component library, etc.
Custom components: Custom The component has its own wxml template and wxss styleHorizontal
Horizontal: component attributes
class | |
style | |
hidden | |
data-* | |
bind* /catch* | |
Data binding
<!--wxml--> <view> {{message}} </view> // page.js Page({ data: { message: 'Hello MINA!' } })List rendering
<!--wxml--> <view> {{item}} </view> // page.js Page({ data: { array: [1, 2, 3, 4, 5] } })Conditional rendering
<!--wxml--> <view> WEBVIEW </view> <view> APP </view> <view> MINA </view> // page.js Page({ data: { view: 'MINA' } })The block used to wrap the view component
If wx: for, wx:if To render a view container, you can wrap it with a block tag. The block tag is not a component, but an element used for packaging. It will not be rendered and only accepts wx:.. control attributes.
block and wx:if:<block> <view> view1 </view> <view> view2 </view> </block>block and wx:for:
<block> <view> {{index}}: </view> <view> {{item}} </view> </block>Recommended tutorial: "
WeChat Mini Program
"The above is the detailed content of WeChat mini program page development. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 English version
Recommended: Win version, supports code prompts!

WebStorm Mac version
Useful JavaScript development tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Zend Studio 13.0.1
Powerful PHP integrated development environment