目录

HXML

Conventionally, web page development uses HTML, CSS, and JS together. HTML describes the page structure, CSS describes the page style, and JS compiles page logic and interaction.

ASCF adopts the same combination except that it uses HXML instead of HTML.

The following examples show the capabilities of HXML.

Data Binding

<!--HXML-->
<view>{{ message }}</view>
// page.js
Page({
  data: {
    message: 'Hello World!'
  }
})

List Rendering

<!--HXML-->
<view has:for="{{ array }}" has:key="id" has:for-index="idx">{{ item }}</view>
// page.js
Page({
  data: {
    array: [0, 1, 2, 3, 4]
  }
})

Conditional Rendering

<!--HXML-->
<view has:if="{{ view === 'test1' }}">test1</view>
// page.js
Page({
  data: {
    view: 'test1'
  }
})