在 [component].json 中声明自定义组件。如果该自定义组件还依赖了其它组件,则还需要额外声明依赖哪些自定义组件。
{"component": true, // 必选,自定义组件的值必须是true"usingComponents": {"other":"../other/index" // 依赖的组件}}
参数详情:
| 参数 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| component | Boolean | 是 | 声明是自定义组件 |
| usingComponents | Object | 否 | 声明依赖的自定义组件所在路径:项目绝对路径以 / 开头,相对路径以 ./ 或者 ../ 开头 |
该文章对您有帮助吗?