Skip to content

Commit cdad5ef

Browse files
committed
fix: add usePreviewComponents (default true) for users who want to use own Preview components
1 parent 16c442d commit cdad5ef

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

index.ts

+10-8
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,17 @@ getBucketLifecycleConfiguration on bucket ${this.options.s3Bucket} in region ${t
165165
const pathColumn = resourceConfig.columns[pathColumnIndex];
166166

167167
// add preview column to list
168-
resourceConfig.columns[pathColumnIndex].components.list = {
169-
file: this.componentPath('preview.vue'),
170-
meta: pluginFrontendOptions,
171-
};
168+
if (this.options.preview?.usePreviewComponents !== false) {
169+
resourceConfig.columns[pathColumnIndex].components.list = {
170+
file: this.componentPath('preview.vue'),
171+
meta: pluginFrontendOptions,
172+
};
172173

173-
resourceConfig.columns[pathColumnIndex].components.show = {
174-
file: this.componentPath('preview.vue'),
175-
meta: pluginFrontendOptions,
176-
};
174+
resourceConfig.columns[pathColumnIndex].components.show = {
175+
file: this.componentPath('preview.vue'),
176+
meta: pluginFrontendOptions,
177+
};
178+
}
177179

178180
// insert virtual column after path column if it is not already there
179181
const virtualColumnIndex = resourceConfig.columns.findIndex((column: any) => column.name === virtualColumn.name);

types.ts

+5
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ export type PluginOptions = {
6565

6666
preview?: {
6767

68+
/**
69+
* Whether to use preview components provided by the plugin. BY default true
70+
*/
71+
usePreviewComponents?: boolean,
72+
6873
/**
6974
* Maximum width of the preview image
7075
*/

0 commit comments

Comments
 (0)