前端常用的知识(持续更新)

  1. //数组中,去除空白的内容 如
    let a=['1',' ','3','4']
    方法 a.filter(i=>i)
    得到a=['1','3','4']
  2. //遮罩层
    <div class="mask" @tap="hideView"></div>
            <!-- 弹框 -->
    <div class="termBox">
     内容
     </div> 
    <!--csss==============-->
    .mask {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
        }
    
        .termBox {
            width: 80%;
            height: 80%;
            border: 2rpx solid #999;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: #f8f5f5;
            font-size: 18rpx;
        }

     

posted @ 2025-08-23 13:40  泫然  阅读(6)  评论(0)    收藏  举报