美文网首页
web性能优化

web性能优化

作者: 无花无酒_3cd3 | 来源:发表于2019-11-30 14:59 被阅读0次

Preload,Prefetch的使用

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <!-- 引入样式 -->
   <!--  <link rel="preload" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css"> -->
    <link rel='preload' href="https://unpkg.com/element-ui/lib/index.js" as="script" >
    <!-- 引入组件库 -->
  
</head>
<body>
    <div class="left"></div>
    <div class="right"></div>
 <div class="box">
     <div class="box1">1</div>
     <div class="box2">2</div>
 </div>
    
<style>
/*方法一: BFC(块级格式化上下文)*/
    .container{
        width:1000px;height:400px;border: 1px solid red;
    }
    .left{
        width:200px;height:200px;background: gray;
        float: left;
    }
    .right{
        overflow:hidden;  /* 触发bfc */
        height:200px;
        background: green;
    }
    .box{
        display: flex;

    }
    .box1{
        background :red;
        width: 200px
    }
    .box2{
        flex: 1;
        background :green;
    }
     </style>
     <script>
           let arr1 = [1,2,3,4,5];
            let arr2 = [...arr1,0];
           
            arr2[0] = "1000"
            console.log(arr1)
            console.log(arr2)
            console.log(window.WebViewJavascriptBridge)
            var arr = [1,2,3]
            console.log(arr) 
            console.log(arr.toLocaleString()) 

     </script>
     <!-- <script src="https://unpkg.com/element-ui/lib/index.js"></script>  -->
</body>
</html>

相关文章

网友评论

      本文标题:web性能优化

      本文链接:https://www.haomeiwen.com/subject/ntuowctx.html