Skip to content

Commit 2384495

Browse files
committed
release v0.2.5
1 parent ba1e166 commit 2384495

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

example/vue2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"sass": "^1.49.9",
1515
"typescript": "^4.5.2",
1616
"vite": "^2.7.1",
17-
"vite-plugin-vue-inspector": "0.2.3",
17+
"vite-plugin-vue-inspector": "0.2.5",
1818
"vite-plugin-vue2": "^1.9.3"
1919
}
2020
}

example/vue3/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
"sass": "^1.49.9",
1616
"typescript": "^4.5.2",
1717
"vite": "^2.7.1",
18-
"vite-plugin-vue-inspector": "0.2.3"
18+
"vite-plugin-vue-inspector": "0.2.5"
1919
}
2020
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vite-plugin-vue-inspector",
3-
"version": "0.2.3",
3+
"version": "0.2.5",
44
"description": "jump to local IDE source code while click the element of browser automatically.",
55
"license": "MIT",
66
"repository": {

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ import { queryParserMiddleware, launchEditorMiddleware } from "./middleware"
66

77
export type VitePluginInspectorOptions = {
88
vue?: number
9+
enabled?: boolean
910
}
1011

11-
function VitePluginInspector(options: VitePluginInspectorOptions = { vue: 3 }): Plugin {
12+
function VitePluginInspector(options: VitePluginInspectorOptions = { vue: 3, enabled: true }): Plugin {
1213
const { scripts, styles, overlayContainerScript } = options.vue === 2 ? v2 : v3
1314

1415
return {
@@ -35,7 +36,7 @@ function VitePluginInspector(options: VitePluginInspectorOptions = { vue: 3 }):
3536
html,
3637
tags: [{
3738
tag: "script",
38-
children: overlayContainerScript,
39+
children: `window.__VUE_INSPECTOR_INITIAL_ENABLED__=${options.enabled ?? true};${overlayContainerScript}`,
3940
injectTo: "body",
4041
}, {
4142
tag: "script",

src/overlay/Overlay.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default {
4242
return {
4343
target: null,
4444
overlayTarget: null,
45-
disabled: false,
45+
disabled: !window.__VUE_INSPECTOR_INITIAL_ENABLED__,
4646
overlayVisible: false,
4747
4848
navigationParams: {

src/overlay/index.json

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)