zoukankan      html  css  js  c++  java
  • vue移动端适配

    App.vue
    <template>
      <div id="app">
        <router-view />
      </div>
    </template>

    <script>
    export default {
      name: "App",
      mounted() {
      
       //移动端适配
        var html = document.getElementsByTagName("html")[0];
        var owidth =
          document.body.clientWidth || document.documentElement.clientWidth;
          html.style.fontSize = (owidth / 375) * 12 + "px";
        
      },
    };
    </script>

    <style >
    #app {
      100%;
     height: 100%;
     
    }
    </style>
    正道的光终将来临,当太阳升起的时候,光芒总会普照大地温暖人间。些许的阴霾也终会有被阳光洒满的一天
  • 相关阅读:
    构造和析构
    const修饰的成员函数
    class和struct权限
    封装加强
    函数重载实现原理
    Unity2019破解hub
    Lua模拟stack
    函数重载
    LeanTween
    占位参数和默认参数
  • 原文地址:https://www.cnblogs.com/sjruxe/p/15084964.html
Copyright © 2011-2022 走看看