CSS实现遮罩层

close
data(){
      return {
        vm:{
          dialogShow:false
        }
      }
    },
    methods:{
      open(){
        this.vm.dialogShow = true
      },
      close(){
        this.vm.dialogShow = false
      }
    }

#main{
    width: 100%;
    height: 100%;
  }
  #dialog{
    border-radius: 15px;
    text-align: center;
    width: 50%;
    height: 50%;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    margin: auto;
    background-color: white;
  }
  .box{
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(0,0,0,0.3);
  }

CSS实现遮罩层_第1张图片


你可能感兴趣的:(css)