ソースを参照

📝 docs(debug): add vconsole debugging tool support

-引入vconsole.3.15.1.min.js用于移动端调试
-实现vconsole初始化逻辑,支持通过URL参数vconsole_theme设置主题
-添加初始化就绪日志输出,便于调试状态确认
yourname 4 ヶ月 前
コミット
a9bd68680a
1 ファイル変更14 行追加0 行削除
  1. 14 0
      mini/src/index.html

+ 14 - 0
mini/src/index.html

@@ -10,6 +10,20 @@
   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" >
   <title>mini</title>
   <script><%= htmlWebpackPlugin.options.script %></script>
+  <script src="https://ai-oss.d8d.fun/umd/vconsole.3.15.1.min.js"></script>
+  <script>
+    const init = () => {
+      const urlParams = new URLSearchParams(window.location.search);
+      // if ( !urlParams.has('vconsole')) return;
+      var vConsole = new VConsole({
+        theme: urlParams.get('vconsole_theme') || 'light',
+        onReady: function() {
+          console.log('vConsole is ready');
+        }
+      });
+    }
+    init();
+  </script>
 </head>
 <body>
   <div id="app"></div>