Back to Uni App

Ad Custom

docs/component/ad-custom.md

2.3.32.7 KB
Original Source
<!-- ## ad-custom -->

::: sourceCode

ad-custom

:::

兼容性

Web微信小程序AndroidiOSHarmonyOSHarmonyOS(Vapor)
<a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a>4.41<a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a><a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a><a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a>-

属性

名称类型默认值兼容性描述
unit-idstring-Web: x; 微信小程序: 4.41; Android: x; iOS: x; HarmonyOS: x; HarmonyOS(Vapor): -(string)
广告单元id,可在小程序管理后台的流量主模块新建
ad-intervalsnumber-Web: x; 微信小程序: 4.41; Android: x; iOS: x; HarmonyOS: x; HarmonyOS(Vapor): -(number)
广告自动刷新的间隔时间,单位为秒,参数值必须大于等于30(该参数不传入时 模板 广告不会自动刷新)
@loadeventhandle-Web: x; 微信小程序: 4.41; Android: x; iOS: x; HarmonyOS: x; HarmonyOS(Vapor): -(eventhandle)
广告加载成功的回调
@erroreventhandle-Web: x; 微信小程序: 4.41; Android: x; iOS: x; HarmonyOS: x; HarmonyOS(Vapor): -(eventhandle)
广告加载失败的回调,event.detail = {errCode: 1002}
<!-- UTSCOMJSON.ad-custom.component_type -->

参见