Introduction
WXML (WeiXin Markup Language) is a tag language designed by the framework. Combined with base components and the event system, it can be used to build the structure of a page.
AIUI supports a WXML subset similar to WeChat Mini Programs. These examples show common page structure and data usage:
Data Binding
<!--wxml-->
<view> {{message}} </view>
// page.js
export default {
data: {
message: 'Hello MINA!'
}
}
Conditional Rendering
<!--wxml-->
<view ink:if="{{view == 'WEBVIEW'}}"> WEBVIEW </view>
<view ink:elif="{{view == 'APP'}}"> APP </view>
<view ink:else> MINA </view>
// page.js
export default {
data: {
view: 'MINA'
}
}
List Rendering
<!--wxml-->
<view ink:for="{{array}}"> {{item}} </view>
// page.js
export default {
data: {
array: [1, 2, 3, 4, 5]
}
}
Reuse an Interface
To use the same interface in multiple places, create a custom component. A single-file interface with incremental update support can also use region updates to add content as it arrives.