From 9a1f62b65d6e5bd89c81cd40e703d36e835a9fae Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Thu, 19 Mar 2020 19:42:45 +0800 Subject: [PATCH] feat(h5): disable vue devtools tips in HBuilderX --- src/core/service/plugins/index.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/core/service/plugins/index.js b/src/core/service/plugins/index.js index d57a47843..fb2350724 100644 --- a/src/core/service/plugins/index.js +++ b/src/core/service/plugins/index.js @@ -59,7 +59,17 @@ function getLocation (base = '/') { export default { install (Vue, { routes - } = {}) { + } = {}) { + if ( + __PLATFORM__ === 'h5' && + Vue.config.devtools && + typeof window !== 'undefined' && + window.navigator.userAgent.toLowerCase().indexOf('hbuilderx') !== -1 + ) { + // HBuilderX 内置浏览器禁用 devtools 提示 + Vue.config.devtools = false + } + initPolyfill(Vue) lifecycleMixin(Vue) -- GitLab