<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. chatgpt与搜索结合,百度会在这股浪潮下掘金吗?

    年末,在百度内部沟通会上,百度创始人李彦宏提到最近他的朋友们问他如何看待ChatGPT,包括他周围同行业中的同一领域和跨境人士. ​事实上,早在ChatGPT将他的对话能力和直观的互动方式展现给全世界 ...

  2. ESP32-MicroPython 开发环境

    Linux/Mac 下使用MicroPython开发ESP32 刷入固件 使用 esptool.py 将 MicroPython 刷入 ESP32 开发板涉及几个步骤. 1. 安装 esptool 如 ...

  3. 解密Prompt系列17. LLM对齐方案再升级 WizardLM & BackTranslation & SELF-ALIGN

    话接上文的指令微调的样本优化方案,上一章是通过多样性筛选和质量过滤,对样本量进行缩减,主打经济实惠.这一章是通过扩写,改写,以及回译等半监督样本挖掘方案对种子样本进行扩充,提高种子指令样本的多样性和复 ...

  4. linux 批量替换文件内容

    1.批量查找某个目下文件的包含的内容,例如: #   grep -rn "要找查找的文本" ./ 2.批量查找并替换文件内容. #   sed -i "s/要找查找的文本 ...

  5. 为zabbix穿上一件漂亮的外衣

    zabbix+Grafana 7.0  zabbix的环境已部署好的情况下,zabbix部分-- 略 Grafana简介: 1.Grafana自身并存储数据,数据从其它地方获取.需要配置数据源 2.G ...

  6. 解密Prompt系列18. LLM Agent之只有智能体的世界

    重新回来聊Agent,前四章的LLM Agent,不论是和数据库和模型还是和搜索引擎交互,更多还是大模型和人之间的交互.这一章我们来唠唠只有大模型智能体的世界!分别介绍斯坦福小镇和Chatdev两篇论 ...

  7. 工控机中部署Ubuntu 22.04 系统

    1.下载Ubuntu系统服务器版本 获取Ubuntu服务器版 | Ubuntu 2.下载启动盘制作工具 UltralSO(试用就可以) 文件 > 打开(Ubuntu.ISO) > 启动 & ...

  8. 用原型实现Class的各项语法

    本人之前对Class一直不够重视.平时对原型的使用,也仅限于在构造函数的prototype上挂属性.原型尚且用不着,更何况你Class只是原型的一颗语法糖? 直到公司开始了一个webgis项目,使用o ...

  9. Net 高级调试之八:代码审查及杂项命令

    一.简介 今天是<Net 高级调试>的第八篇文章.这篇文章设计的内容挺多的,比如:如何查看方法的汇编代码,如何获取方法的描述符,对象同步块的转储,对象方法表的转储,托管堆和垃圾回收器信息的 ...

  10. [PostgreSQL]在group by查询下拼接列字符串

    首先创建group_concat聚集函数: CREATE AGGREGATE group_concat(anyelement) ( sfunc = array_append, -- 每行的操作函数,将 ...