1 在根目录下建 components 文件夹,建 组件名称 文件夹,右键,新建component
2. 完善组件内容
3.在要使用的页面*.json中引入注册
官网地址:https://developers.weixin.qq.com/miniprogram/dev/reference/api/Component.html#properties-%E5%AE%9A%E4%B9%89