vue+vue-cli 移动端单页面使用vconsole

只需修改public下的index.html即可

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
    <title>上海</title>
  </head>
  <body>
    <noscript>
      <strong>We're sorry but hello-world doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
    <div id="app"></div>
    <!-- 第一步引入 -->
    <script crossorigin="anonymous" integrity="sha384-Syuu42tkQgszyxNSHWSh4xouXRhTwTLEj9qTUCa3YPdoZYLOIGmFq6z1VTMjS8KL" src="https://lib.baomitu.com/vConsole/3.3.0/vconsole.min.js"></script>
  </body>
</html>

<script>
//第二步配置
window.vConsole = new window.VConsole({
  defaultPlugins: ['system', 'network', 'element', 'storage'], // 可以在此设定要默认加载的面板
  maxLogNumber: 1000,
  onReady: function() {
  // console.log('vConsole is ready.');
  },
  onClearLog: function() {
  // console.log('on clearLog');
  }
}); 
</script>

你可能感兴趣的:(Vant)