Declare the reference in the JSON file of the page. That is, set the tag name and corresponding component path in the usingComponents field.
// page/index.js
{
"usingComponents": {
"my-component": "./components/my-component/my-component"
}
} In the HXML file of the page, you can use custom components in the same way as using basic components. The node name is the tag name of the custom component.
<!--index.hxml --> <view> <my-component /> </view>