弹窗背景图设置,关闭按钮

这个博客展示了如何在Vue中创建一个弹窗组件,包括背景图片、关闭按钮以及内容展示。内容包含了标题、详细信息和关闭操作。样式设计注重了边框圆角、图片定位以及文字颜色和大小。此外,还提到了CSS类的选择和布局设置。

弹窗

<div
  v-show="BackImg"
  class="BackgroundImg"
>
  <img
    class="closeImg"
    src="../../../../assets/close.png"
    @click="()=>{ BackImg = BackImg?false:true }"
  >//右上角x号
    <div>
      <span class="texttitle">最近更新提醒</span>
    </div>
  <div class="TextTop">
    <div style="text-align: center;">
      <span class="title-text">{{ dataForm.title }}</span>
    </div>
    <div style="height: 220px; width: 620px; overflow-y: auto; overflow-x: hidden;margin: auto;">
      <span
        class="title-content"
        v-html="dataForm.content"
      />
    </div>
    <span
      slot="footer"
      class="dialog-footer"
    >
      <el-button
        type="primary"
        @click="BackImg = false"
      >关闭</el-button>
    </span>
  </div>
</div>

css

<style> 
.BackgroundImg{
   background-image: url('../../../../assets/backImg.png');
   background-size: 700px 540px;
   background-repeat:no-repeat;
   position:fixed;
   top: 0;
   bottom: 0;
   left: 0;
   right: 0;
   margin: auto;
   width: 700px;
   height: 540px;
   z-index: 99999;
   border-bottom-right-radius: 2em 2em;
   border-bottom-left-radius:  2em 2em;
}
.closeImg{
  margin-top: 70px;
  margin-left: 655px;
}
.closeImg:hover{
  cursor:pointer
}
//弹窗名称(标题)
.texttitle{
  color: #fff;
  font-size: 26px !important;
  margin-left: 45px;
}
.TextTop{
  margin-top: 115px;
  // margin-right: 50px;
  // margin-left: 50px;
  // text-align: center;
}
//内容标题
.title-text {
  color: #000;
  /* color: #0B2278; */
  font-size: 16px !important;
  font-weight: bold;
  line-height: 22px;
}
//内容
.title-content {
  width: 40%;
  color: #000;
  /* color: #0B2278; */
  font-size: 40px !important;
  line-height: 30px;
}
.title-content {
  vertical-align: middle;
  border-style: none;
  width: 50%;
  height: 50%;
}
//关闭input位置
.dialog-footer{
  margin-left: 45%;
}
</style>

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值