酷狗直播小程序核心组件
Api
render(Component)
渲染小程序页面
参数
Name | Type | Required | Description |
---|---|---|---|
Component | react component | true | 根节点组件 |
App组件
props
title: string
小程序标题
titleStyle: 'black' | 'white'
小程序主题
titleBarColor: string
小程序标题栏背景色, eg:#3E2597
init: Function<Promise>
小程序初始化方法,必须返回Promise,调用resolve则展示页面,reject则显示错误页面,错误页面点击则会重新执行init方法
routers: Router[]
页面路由配置, eg:
[{
path: '/record',
component: Record,
title: '摇中记录', // 非必要
titleBarColor: '#3E2597', // 非必要
titleStyle: 'white' // 非必要
}]
GiftPicker组件
props
onSelect: Function
礼物选择结果回调
onClose: Function
礼物选择面板关闭回调
showGiftPicker方法
拉起礼物选择面板 示例:
import { showGiftPicker } from '@fxext/core';
showGiftPicker(result => console.log('选择的礼物是:', resule));