Open Vue devtools

检测到Vue环境时,默认打开vue开发工具的开关

当前为 2021-06-11 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Open Vue devtools
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @description 检测到Vue环境时,默认打开vue开发工具的开关
  6. // @author YUYIDM
  7. // @match http://*/*
  8. // @match https://*/*
  9. // @icon https://cn.vuejs.org/images/logo.svg
  10. // @grant none
  11. // @run-at document-start
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. var Vue = window.Vue;
  17. Object.defineProperty(window, 'Vue', {
  18. get() {
  19. return Vue;
  20. },
  21.  
  22. set(v) {
  23. console.log(
  24. `%c Tips: %c 检测到Vue环境 %c`,
  25. 'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff',
  26. 'background:#41b883 ; padding: 1px; border-radius: 0 3px 3px 0; color: #fff',
  27. 'background:transparent'
  28. )
  29. v.config.devtools = true;
  30. Vue = v;
  31. }
  32. })
  33. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址