English
list.previewImage.before
About 132 wordsLess than 1 minute
2025-12-16
This hook is called before previewing images in list image fields. List common parameters are not supported here. Execute extra business logic before previewing images:
- Preview images in another way
Parameters
| Parameter | Description | Type | Optional Values | Default |
|---|---|---|---|---|
| objectApiname | Object apiName | string | — | — |
| fieldName | Field apiName | string | — | — |
| data | Field value | object[] | — | — |
| trData | Current row data | object | — | — |
| startIndex | Index of the clicked image | number | — | — |
| field | Field describe | object | — | — |
Return Value
| Parameter | Description | Type | Optional Values | Default |
|---|---|---|---|---|
| stopPreView | Whether to stop previewing (example) | boolean | — | — |
Basic Examples
Basic Usage
export default class Plugin {
apply() {
return [{
event: "list.previewImage.before",
functional: this.previewBefore.bind(this)
}];
}
previewBefore(context, plugin) {
console.log(context.fieldName);
console.log(context.data);
}
}Prevent Preview
export default class Plugin {
apply() {
return [{
event: "list.previewImage.before",
functional: this.previewBefore.bind(this)
}];
}
previewBefore(context, plugin) {
return Promise.resolve({
stopPreView: true
})
}
}