Skip to content

Commit 665455f

Browse files
rigor789yyx990803
authored andcommitted
feat(devtool): allow usage in non-browser environments (#1404)
1 parent 1fd2fc4 commit 665455f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Diff for: src/plugins/devtool.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
const devtoolHook =
2-
typeof window !== 'undefined' &&
3-
window.__VUE_DEVTOOLS_GLOBAL_HOOK__
1+
const target = typeof window !== 'undefined'
2+
? window
3+
: typeof global !== 'undefined'
4+
? global
5+
: {}
6+
const devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__
47

58
export default function devtoolPlugin (store) {
69
if (!devtoolHook) return

0 commit comments

Comments
 (0)