定制主题色对接:
1. 定制主题色对接:
前端接收消息传递(postMessage), 通过type等于 THEME_COLOR,value等于customized_blue,接收返回的数据。
window.addEventListener('message', this.themeColorHandler);返回格式:
event = {
data:{
type: "THEME_COLOR",
value: "customized_blue",
}
}
验证方式:前端接收操作,满足条件会在日志打印监听定制主题色==>
themeColorHandler(event) {
if (event.data.type === 'THEME_COLOR' && event.data.value === 'customized_blue'') {
console.log('监听定制主题色==>', event.data)
}
},文档更新时间: 2026-05-17 11:59 作者:张永丰