AppML 学习手册

免费学习 完整知识体系 快速检索 数据驱动 / 轻量级

AppML 学习手册《第一个 AppML 应用》:创建一个简单的 AppML 应用,显示客户列表[reference:32]。 步骤 1:创建 HTML 页面 <!DOCTYPE html> <html> <head> <title&gt...

快速入门

第一个 AppML 应用

【详细说明 & 代码示例】
创建一个简单的 AppML 应用,显示客户列表[reference:32]。 步骤 1:创建 HTML 页面
<!DOCTYPE html>
<html>
<head>
    <title>AppML 示例</title>
    <script src="https://www.w3schools.com/appml/2.0.3/appml.js"></script>
</head>
<body>
    <h1>客户列表</h1>
    <div appml-data="customers.json">
        <table>
            <tr><th>姓名</th><th>地址</th><th>城市</th></tr>
            <tr appml-repeat="Customer">
                <td>{{CustomerName}}</td>
                <td>{{Address}}</td>
                <td>{{City}}</td>
            </tr>
        </table>
    </div>
</body>
</html>
步骤 2:创建数据文件 customers.json
{
    "rows": [
        {"CustomerName": "John Doe", "Address": "123 Main St", "City": "New York"},
        {"CustomerName": "Jane Smith", "Address": "456 Oak Ave", "City": "London"}
    ]
}

学习提示:建议将示例代码复制到 HTML 文件中,通过本地服务器(如 VS Code Live Server)运行,观察数据绑定效果。

使用说明

  • • 本手册涵盖 AppML 从入门到进阶的完整知识体系
  • • 在搜索框输入关键词,快速定位相关知识点
  • • 点击条目标题进入详情页,查看详细说明与代码示例
  • • 页面按分类展示所有知识点,方便系统性学习
  • • 建议在 HTML 文件中运行示例代码,通过本地服务器观察效果