MiniX自绘渲染跨平台框架
  • 框架说明
  • 声明式开发范式
  • 内置Api
指南
接口
  • Minix CLI
示例
  • 类Web框架

    • 框架说明
    • 类Web开发范式
    • 内置Api
  • 指南
  • 组件
  • 接口
  • 示例
  • 规范
  • DophinHybrid

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • DolphinWeex

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • 发布消息
  • 常见问题
  • 更新日志
  • 框架说明
  • 声明式开发范式
  • 内置Api
指南
接口
  • Minix CLI
示例
  • 类Web框架

    • 框架说明
    • 类Web开发范式
    • 内置Api
  • 指南
  • 组件
  • 接口
  • 示例
  • 规范
  • DophinHybrid

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • DolphinWeex

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • 发布消息
  • 常见问题
  • 更新日志
  • 导航
  • 快速上手

    • 搭建开发环境
    • DevEco使用指南

    • 创建并运行工程
    • 目录规范
    • app 配置说明
      • 本地调试

    # config.json

    • 在应用开发的工程中,需要在 config.json 配置文件中对应用的包结构进行声明。
    • “config.json”由 app,deviceConfig 和 module 三个部分组成,缺一不可。

    在/entry/src/main目录下创建一个 config.json 文件,minix 工程模版中已内置该文件。

    {
      "app": {
        "bundleName": "com.example.tack_api_8", // 应用的包名,用于标识应用的唯一性。
        "vendor": "example", // 应用开发厂商的描述。
        // 应用的版本信息
        "version": {
          "code": 1000000, // 应用的版本号,仅用于OpenHarmony管理该应用
          "name": "1.0.0" // 应用的版本号,用于向应用的终端用户呈现
        }
      },
      // 设备上的应用配置信息
      "deviceConfig": {},
      // 包含HAP包的配置信息
      "module": {
        "package": "com.example.tack_api_8", // HAP的包结构名称,在应用内保证唯一性
        "name": ".entry", // HAP的类名
        "mainAbility": ".MainAbility", // 服务中心图标露出的ability,常驻进程拉起时会启动mainAbility
        "deviceType": ["default", "tablet"], // 允许Ability运行的设备类型
        // HAP发布的具体描述
        "distro": {
          "deliveryWithInstall": true,
          "moduleName": "entry", // 当前HAP的名称
          "moduleType": "entry", // 当前HAP的类型
          "installationFree": false // 当前HAP是否支持免安装特性
        },
        // 当前模块内的所有Ability
        "abilities": [
          {
            // Ability能够接收的want的特征
            "skills": [
              {
                "entities": ["entity.system.home"], // 能够接收的want的Ability的类别
                "actions": ["action.system.home"] // 能够接收的want的action值
              }
            ],
            "orientation": "unspecified", // Ability的显示模式
            "formsEnabled": false, // Ability是否支持卡片(forms)功能
            "name": ".MainAbility", // Ability名称
            "srcLanguage": "ets", // Ability开发语言的类型
            "srcPath": "MainAbility", // Ability对应的JS组件代码路径
            "icon": "$media:icon", // 图标资源文件的索引
            "description": "$string:MainAbility_desc", // 对Ability的描述
            "label": "$string:MainAbility_label", // Ability对用户显示的名称
            "type": "page", // Ability的类型
            "visible": true, // Ability是否可以被其他应用调用
            "launchType": "standard" // Ability的启动模式
          }
        ],
        // JS模块集合
        "js": [
          {
            // JS组件的开发模式
            "mode": {
              "syntax": "ets",
              "type": "pageAbility"
            },
            // JS Component的页面用于列举JS Component中每个页面的路由信息
            "pages": ["pages/index", "pages/home", "pages/detail/index"],
            "name": ".MainAbility", // JS Component的名字
            // 定义与显示窗口相关的配置
            "window": {
              "designWidth": 720, // 页面设计基准宽度
              "autoDesignWidth": false // 页面设计基准宽度是否自动计算
            }
          }
        ]
      }
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68

    TIP

    完整的配置信息请查看应用包结构说明