打开自定义组件
FxUI.userDefine.openCustomComponent(Object)
# 功能描述
该方法允许您打开一个小程序的自定义组件。
# 参数
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
components | 组件 | array/object | — | — |
type | 显示模式,「ShowCenter 居中弹框」「FullScreen 全屏显示」 | string | ShowCenter/FullScreen | FullScreen |
width | 宽度(居中弹框模式生效) | string | — | '' |
height | 高度(居中弹框模式生效) | string | — | '' |
components为对象时
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
apiName(必填) | 组件apiName | string | - | — |
url(选填) | 组件压缩地址 | string | - | '' |
# 代码示例
import FxUI from 'fxui-mobile';
FxUI.userDefine.openCustomComponent({
components:[{
"apiName":"component_AYPWh__c",
"url": "" //有组件地址可以节省一次接口调用
}]
}).then((res) => {
//自定义组件回传的数据
})
or
import FxUI from 'fxui-mobile';
FxUI.userDefine.openCustomComponent({
component:{
"apiName":"component_AYPWh__c",
"url": ""//有组件地址可以节省一次接口调用
}
}).then((res) => {
//自定义组件回传的数据
})