阅读(4296) (0)

支付宝小程序框架 自定义组件·配置

2020-09-07 10:45:10 更新

[componentName].json 中声明自定义组件。如果该自定义组件还依赖了其它组件,则还需要额外声明依赖哪些自定义组件。

{
  "component": true, // 必选,自定义组件的值必须是 true
  "usingComponents": {
    "other":"../other/index" // 依赖的组件
  }
}

参数

参数 类型 是否必填 说明
component Boolean 声明是自定义组件
usingComponents Object 声明依赖的自定义组件所在路径: 项目绝对路径以 “/” 开头,相对路径以 “./” 或者 “../” 开头