File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,12 @@ export interface VitePluginInspectorOptions {
7676 * @default false
7777 */
7878 openInEditorHost ?: string | false
79+
80+ /**
81+ * lazy load inspector times (ms)
82+ * @default false
83+ */
84+ lazyLoad ?: number | false
7985}
8086
8187const toggleComboKeysMap = {
@@ -101,6 +107,7 @@ export const DEFAULT_INSPECTOR_OPTIONS: VitePluginInspectorOptions = {
101107 toggleButtonPos : 'top-right' ,
102108 appendTo : '' ,
103109 openInEditorHost : false ,
110+ lazyLoad : false ,
104111} as const
105112
106113function VitePluginInspector ( options : VitePluginInspectorOptions = DEFAULT_INSPECTOR_OPTIONS ) : PluginOption {
Original file line number Diff line number Diff line change @@ -37,4 +37,8 @@ function load() {
3737 } ) . $mount ( `#${ CONTAINER_ID } ` )
3838}
3939
40- load ( )
40+ if ( inspectorOptions . lazyLoad )
41+ setTimeout ( load , inspectorOptions . lazyLoad )
42+
43+ else
44+ load ( )
You can’t perform that action at this time.
0 commit comments