English
detail.head_info.render.before
About 179 wordsLess than 1 minute
2025-12-16
This hook is triggered before the detail page header component is rendered. Execute extra business actions before rendering the object detail header component, including but not limited to the following capabilities:
- Component data
Parameters
| Parameter | Description | Type | Allowed Values | Default |
|---|---|---|---|---|
| Common parameters | See details | -- | -- | -- |
Return Value
| Parameter | Description | Type | Allowed Values | Default |
|---|---|---|---|---|
| buttons | Object operation buttons (example) | Object | -- | |
| component | Component (example) | Object | -- |
Basic Example
Basic Usage:
export default class Plugin {
apply() {
return [{
event: 'detail.head_info.render.before',
functional: this.renderBefore.bind(this)
}]
}
renderBefore(context, plugin) {
return Promise.resolve();
}
}Custom Buttons
export default class Plugin {
apply() {
return [{
event: 'detail.head_info.render.before',
functional: this.renderBefore.bind(this)
}]
}
renderBefore(context, plugin) {
return Promise.resolve({
buttons: {
del: ['ChangeOwner'],
add: [{
action: 'cancel',
label: 'Cancel 11',
callback(context) {
alert('Cancel 11');
}
}],
reset: [{
action: 'Edit',
label: 'Edit from Detail Page'
}, {
action: 'Clone',
label: 'Duplicate Clone',
callback() {
alert('Duplicate plugin');
}
}]
}
});
}
}Component
export default class Plugin {
apply() {
return [{
event: 'detail.head_info.render.before',
functional: this.renderBefore.bind(this)
}]
}
renderBefore(context, plugin) {
return Promise.resolve({
component: { ...context.component }
});
}
}Notes
1. Refreshing the detail page will also trigger this hook
