简体中文
detail.parse.before
约 268 字小于 1 分钟
2025-12-16
该钩子发生在详情页处理数据之前。 渲染对象详情之前处理或者修改详情页数据
参数
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---|---|---|---|---|
| 通用参数 | 详见 | -- | -- | -- |
| data | 接口下发的对象详情数据:详情布局、详情数据等 | Object | -- | -- |
返回结果
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---|---|---|---|---|
| data | 对象详情渲染依赖的数据(遵循接口下发的数据结构) | Object | -- | -- |
基础示例
基础用法:
export default class Plugin {
apply() {
return [{
event: 'detail.parse.before',
functional: this.renderBefore.bind(this)
}]
}
renderBefore(plugin, context) {
// 修改接口数据
return Promise.resolve(context.data);
}
}页签是否支持记忆
export default class Plugin {
apply() {
return [{
event: 'detail.parse.before',
functional: this.renderBefore.bind(this)
}]
}
renderBefore(plugin, context) {
return Promise.resolve({
tabsMemoryTab: false // true 记忆 false 不记忆 默认不记忆
});
}
}右侧区域是否支持默认收起
export default class Plugin {
apply() {
return [{
event: 'detail.parse.before',
functional: this.renderBefore.bind(this)
}]
}
renderBefore(plugin, context) {
return Promise.resolve({
miniSide: false // true 收起 false 展开 默认走本地缓存数据
});
}
}注意事项
1. 详情页刷新也会触发此钩子的执行
