简体中文
getLayout
约 148 字小于 1 分钟
2025-09-22
该方法同步返回当前详情对象的布局数据,取自详情页接口返回的 layout 字段值。

参数
无
返回结果
仅列举部分字段数据
| 字段 | 说明 | 类型 |
|---|---|---|
| api_name | 对象apiName | String |
| button_style | 操作按钮布局样式 | Object |
| buttons | 操作按钮数组 | Array |
| components | 关联组件数组 | Array |
| 其他字段 | — | — |
代码示例
插件内:
module.exports = function (context, pluginService, pluginParam) {
return {
apply() {
return [
{
event: 'detail.render.before',
functional: function (pluginExecResult, options) {
console.log('custom plugin: detail.render.before exec')
// 获取当前详情对象的布局数据
console.log(context.getLayout())
}
}
]
}
}
}