<template>
<div class="hello">
<button @click="toggleModal">打开Modal对话框</button>
<div class="modal-backdrop" v-if="showModal">
<div class="modal">
<div class="modal-header">
<h3>我是一个Modal的标题</h3>
</div>
<div class="modal-body">
<p>我是一个Modal的内容</p>
</div>
<div class="modal-footer">
<button type="button" class="btn-close" @click="closeme">关闭</button>
<button type="button" class="btn-confirm">确认</button>
</div>
</div> </div>
</div>
</template> <script>
export default {
name: 'testZCC',
data () {
return {
showModal:false
}
},
methods:{
toggleModal() {
this.showModal = !this.showModal;
},
closeme() {
this.showModal = false;
}
}
}
</script> <!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
font-weight: normal;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
.modal-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba(0,0,0,.3);
display: flex;
justify-content: center;
align-items: center;
}
.modal {
background-color: #fff;
box-shadow: 2px 2px 20px 1px;
overflow-x:auto;
display: flex;
flex-direction: column;
border-radius: 16px;
width: 700px;
}
.modal-header {
border-bottom: 1px solid #eee;
color: #313131;
justify-content: space-between;
padding: 15px;
display: flex;
}
.modal-footer {
border-top: 1px solid #eee;
justify-content: flex-end;
padding: 15px;
display: flex;
}
.modal-body {
position: relative;
padding: 20px 10px;
}
.btn-close, .btn-confirm {
border-radius: 8px;
margin-left:16px;
width:56px;
height: 36px;
border:none;
cursor: pointer;
}
.btn-close {
color: #313131;
background-color:transparent;
}
.btn-confirm {
color: #fff;
background-color: #2d8cf0;
}
</style>

vue遮罩层的更多相关文章

  1. vue 遮罩层阻止默认滚动事件

    vue中提供 @touchmove.prevent 方法可以完美解决这个问题. <div class="child" @touchmove.prevent ></ ...

  2. vue解决遮罩层滚动方法

    vue 遮罩层阻止默认滚动事件 在写移动端页面的时候,弹出遮罩层后,我们仍然可以滚动页面. vue中提供 @touchmove.prevent 方法可以完美解决这个问题 <div class=& ...

  3. vue实现一个移动端屏蔽滑动的遮罩层

    在扯废话浪费大家的时间之前,先上个代码好了,使用vue实现起来很简单-- <div class="overlayer" @touchmove.stop > </d ...

  4. 如何在Vue中,当鼠标hover上元素时,给元素加遮罩层

    介绍 当鼠标hover 上元素时,给元素加一层遮罩层. 效果图 使用 import VueHoverMask from 'vue-hover-mask' export default { compon ...

  5. vue移动端出现遮罩层时在遮罩层滑动时禁止遮罩层下方页面滑动

    h5页面 点击出现弹框时 在遮罩层上面滑动时 下方的页面会出现滑动现象 解决方法 我知道的有以下两种 在遮罩层标签上添加@touchmove.prevent 把遮罩层显示时把下方的父盒子css设置为固 ...

  6. jQuery遮罩层登录对话框

    用户登录是许多网站必备的功能.有一种方式就是不管在网站的哪个页面,点击登录按钮就会弹出一个遮罩层,显示用户登录的对话框.这用方式比较灵活方便.而现在扫描二维码登录的方式也是很常见,例如QQ.微信.百度 ...

  7. 使用CSS3的box-shadow实现双透明遮罩层对话框

    box-shadow介绍 在我之前的一篇文章<从天猫和支付宝身上学习opcity与rgba>中,介绍了实现双透明遮罩层效果的两种方法,分别是opacity和rgba.他们需要分别依赖于不同 ...

  8. jQuery css3鼠标悬停图片显示遮罩层动画特效

    jQuery css3鼠标悬停图片显示遮罩层动画特效 效果体验:http://hovertree.com/texiao/jquery/39/ 效果图: 源码下载:http://hovertree.co ...

  9. jQuery弹出关闭遮罩层

    效果体验:http://keleyi.com/keleyi/phtml/jquery/9.htm 完整代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XH ...

  10. 弹出页面遮罩层,以及web端和移动端阻止遮罩层的滑动。

    最近项目遇到了遮罩层的一些问题,总结一下: 弹出遮罩层 遮罩层弹出有非常多的方法,这里只写出本人用的代码,使用jq操作dom的方法进行实现的. <style>.box{position:a ...

随机推荐

  1. JNI编程之字符串处理

    java中的字符串类型是String,对应的jni类型是jstring,由于jstring是引用类型,所以我们不能像基本数据类型那样去使用它,我们需要使用JNIEnv中的函数去处理jstring,下面 ...

  2. 记一次有趣的 buffer overflow detected 问题分析

    PS:要转载请注明出处,本人版权所有. PS: 这个只是基于<我自己>的理解, 如果和你的原则及想法相冲突,请谅解,勿喷. 环境说明   无 前言   在我开发的一个实验和学习库中,在很久 ...

  3. docker简单部署

    docker 安装部署-yun yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docke ...

  4. AtCoder Beginner Contest 321(ABC321)

    A. 321-like Checker 直接模拟. Code B. Cutoff 直接暴力枚举 \([0\sim100]\),每次把第 \(n\) 个数当作当前枚举的 \(i\),然后看看条件是否满足 ...

  5. C#/.NET/.NET Core优秀项目和框架2023年10月简报

    前言 公众号每月定期推广和分享的C#/.NET/.NET Core优秀项目和框架(公众号每周至少推荐两个优秀的项目和框架当然节假日除外),公众号推文有项目和框架的介绍.功能特点以及部分截图等(打不开或 ...

  6. JUC并发编程学习笔记(三)生产者和消费者问题

    生产者和消费者问题 synchronized版-> wait/notify juc版->Lock 面试:单例模式.排序算法.生产者和消费者.死锁 生产者和消费者问题 Synchronize ...

  7. MVC开发

    我们通过前面的章节可以看到:https://www.liaoxuefeng.com/wiki/1252599548343744/1266264917931808 Servlet适合编写Java代码,实 ...

  8. linux系统centos7安装docker

    1.Docker官网安装地址 https://docs.docker.com/engine/install/centos/#prerequisites 2.离线安装下载地址 https://downl ...

  9. 让 keil MDK 支持C99

    打开options fot target-> C/C++ 在 Misc Controls 中添加 --c99.

  10. L2-029 特立独行的幸福

    #include <bits/stdc++.h> using namespace std; bool isyifu[10010]; bool isunhappy[10010]; bool ...