Browse Source

add hint for vue devtools

Evan You 10 years ago
parent
commit
f858a5de14
1 changed files with 7 additions and 2 deletions
  1. 7 2
      src/index.js

+ 7 - 2
src/index.js

@@ -29,8 +29,13 @@ export default Vue
 
 
 // devtools global hook
 // devtools global hook
 /* istanbul ignore if */
 /* istanbul ignore if */
-if (process.env.NODE_ENV !== 'production') {
-  if (inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__) {
+if (process.env.NODE_ENV !== 'production' && inBrowser) {
+  if (window.__VUE_DEVTOOLS_GLOBAL_HOOK__) {
     window.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit('init', Vue)
     window.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit('init', Vue)
+  } else if (/Chrome\/\d+/.test(navigator.userAgent)) {
+    console.log(
+      'Download the Vue Devtools for a better development experience:\n' +
+      'https://github.com/vuejs/vue-devtools'
+    )
   }
   }
 }
 }