vue2 消息弹框

父页面

<template><div style="margin-top: 20px"><div class="nav-style msg-style"><el-badge :value="value" :max="99" class="num" v-if="value > 0"><i class="el-icon-bell"></i></el-badge><i class="el-icon-bell" v-else></i><message class="news-style" @getNums="getNumsFn"></message></div></div>
</template>
<script>
import message from './message.vue'
export default {components: { message },data() {return {value: 0}},methods: {getNumsFn(val) {this.value = val}}
}
</script><style scoped>
.el-icon-bell {font-size: 16px;
}.nav-style label {text-align: center;width: 16px;height: 16px;position: absolute;top: 3px;right: 16px;
}.nav-style .name {height: 22px;margin-top: 19px;margin-bottom: 19px;font-size: 14px;font-weight: 400;color: #24324c;line-height: 22px;
}.msg-style {position: relative;float: right;margin-right: 100px;
}
.msg-style:hover .news-style {display: block;
}
.msg-style .num {line-height: 100%;
}
::v-deep .msg-style .el-badge__content {margin-top: 3px;padding: 0 3px;/* width: 28px; */min-width: 16px;height: 16px;background: #f2314e;text-align: center;line-height: 16px;font-size: 12px;z-index: 3;
}.nav-style .el-button {font-size: 14px;
}
</style>

子页面(message.vue)

<template><div class="news-style"><div class="msg"><div class="msg-header">消息中心</div><div class="msg-style"><div v-if="msglist.length > 0"><div class="item" v-for="item in msglist" :key="item.id"><span class="blue dot"></span><a:href="item.url"target="_blank":class="[item.url ? 'title-style' : '', 'title']"v-bind:title="msglist.title"><span @click="titleFn(item.id)" v-html="item.title"></span></a></div></div><div class="no-item" v-else><span>暂无新消息,去别的地方看看吧~</span></div></div><div class="msg-footer"><el-button type="text" @click="markFn" :disabled="msglist.length === 0"> 全部标为已读 </el-button><!-- 跳转 --><a class="link" target="_blank" rel="noreferrer" href="#/">查看全部 <i class="el-icon-arrow-right"></i> </a></div></div></div>
</template><script>
export default {data() {return {msglist: [],isRead: false}},created() {this.informationFn() //信息},methods: {informationFn() {// 页面只能先展示2条const falselist = {num: 2,data: [{title: '宫1',id: 'c',url: 'https://fanyi.baidu.com/translate#en'},{title: '宫2',id: '0',url: 'https://www.baidu.com/'}]}this.msglist = falselist.data ? falselist.data : []this.$emit('getNums', falselist.num)},markFn() {const ids = this.msglist.map(item => item.id)// 调接口},titleFn(id) {// 调接口}},beforeDestroy() {}
}
</script><style lang="scss" scoped>
.news-style {position: absolute;// top: 40px;//这个是为了固定的right: -10px;display: none;background-color: #fff;border-radius: 8px;box-shadow: 0px 8px 12px 4px rgba(0, 16, 47, 0.05);transition: all 0.3s;
}
.news-style .msg {position: relative;padding: 20px 0px 28px 28px;width: 356px;height: 313px;height: 230px;
}
.msg-header {margin-bottom: 25px;font-family: PingFangSC-Regular;font-size: 16px;font-weight: normal;line-height: 24px;color: #24324c;
}
.msg-style {overflow-y: scroll;margin-bottom: 64px;padding-right: 28px;.item {display: flex;justify-content: start;align-items: center;height: 40px;line-height: 40px;border-bottom: 1px solid rgba(#00102f, $alpha: 5%);.dot {display: inline-block;margin-right: 6px;min-width: 8px;height: 8px;border-radius: 50%;}.title {white-space: nowrap;overflow: hidden;text-overflow: ellipsis;font-family: PingFangSC-Regular;color: #24324c;}.title-style:hover {color: #2662ff;}}.item:last-child {border: 0;}
}
.msg-style .no-item {display: flex;justify-content: center;align-items: center;flex-direction: column;cursor: default;color: #8c93a1;img {margin: 10px 0 5px 0;}
}
.msg-style .item .red {background: #ff5959;
}
.msg-style .item .org {background: #ff8800;
}
.msg-style .item .blue {background: #5987ff;
}
.msg-footer {position: absolute;bottom: 0;margin-bottom: 28px;display: flex;justify-content: space-between;width: 300px;line-height: 22px;img {vertical-align: bottom;}.link {margin-top: 9px;color: #2662ff;}::v-deep .el-button {font-family: PingFangSC-Regular;font-size: 14px;font-weight: normal;color: rgba(0, 16, 47, 0.65);}::v-deep .el-button--text.is-disabled {color: #bfc3cb;}
}
</style>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/601667.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

树莓派 GPIO 教程

1.树莓派引脚分类 电源引脚:5v&#xff0c;3.3v&#xff0c;GND(Ground)。常规GPIO控制引脚:可以通过编写程序控制这些引脚的高低电平。特殊GPIO通讯引脚: SPI通讯&#xff0c;12C通讯&#xff0c;TxD/RxD串口通讯。 2.树莓派引脚编码 功能物理引脚&#xff1a;这种编码方式…

深度生成模型之图像翻译GAN ->(个人学习记录笔记)

文章目录 深度生成模型之图像翻译GAN图像翻译的应用1. 风格迁移2. 数据增强3. 经典图像任务4. 内容创作5. 人脸图像编辑6. 人体图像编辑 图像翻译模型1. 有监督图像翻译模型2. 无监督图像翻译模型3. 多域图像翻译模型 深度生成模型之图像翻译GAN 图像翻译的应用 1. 风格迁移 …

【MySQL】MySQL 8+版本使用窗口函数可以减少一次连表操作(额外Avg函数和Using函数使用,Using关键字参考里自行了解)

力扣题 1、题目地址 1126. 查询活跃业务 2、模拟表 事件表&#xff1a;Events Column NameTypebusiness_idintevent_typevarcharoccurencesint (business_id, event_type) 是这个表的主键&#xff08;具有唯一值的列的组合&#xff09;。表中的每一行记录了某种类型的事件…

8、VS中Git使用

VS中Git使用 1.基础操作1.1 VS配置Git1.2 操作界面 2.本地库版本管理2.1 创建管理本地库2.2 暂存、存储2.3 提交2.4 版本切换 3.分支操作3.1 分支应用3.2 新建分支3.3 合并分支、解决冲突3.4 删除分支 4.远程库版本管理4.1 新建、克隆4.2 提取、拉取、推送与同步4.3 团队开发 最…

深入Pandas(二):高级数据处理技巧

文章目录 系列文章目录引言时间序列分析可视化示例 高级数据分析技术分组与聚合操作时间序列分析 高级数据操作数据合并与重塑示例&#xff1a;数据合并merge示例&#xff1a;数据合并concat示例&#xff1a;数据重塑 - 透视表 高级索引技巧 结论 系列文章目录 Python数据分析…

30、共空间模式CSP与白化矩阵

CSP算法和PCA降维都涉及到了白化&#xff0c;那白化的目的和作用到底是啥呢&#xff1f; 矩阵白化目的&#xff1a; 对于任意一个矩阵X&#xff0c;对其求协方差&#xff0c;得到的协方差矩阵cov(X)并不一定是一个单位阵。 下面介绍几个线代矩阵的几个概念&#xff1a; 1、…

[蓝桥杯学习] 树状树组

lowbit操作 数字二进制表达中的最低位1以及后面所有的0&#xff0c;函数写法如下&#xff1a; int lowbit(int x){return x&-x;} 例如说&#xff0c;lowbit(0101100100) (100) lowbit(4) 4 lowbit(6) 2 时间复杂度o(1) 树状数组 应用 进行单点修改和区间查询…

Hadoop集群三节点搭建(二)

一、克隆三台主机&#xff08;hadoop102 hadoop103 hadoop104&#xff09; 以master为样板机克隆三台出来&#xff0c;克隆前先把master关机 按照上面的步骤克隆其他两个就可以了&#xff0c;记得修改ip和hostname 二、编写集群同步脚本 在/home/attest/ 创建bin目录&…

Conda所有的指令说明

基本指令&#xff1a; conda info&#xff1a;显示有关Conda环境的信息。conda list&#xff1a;列出当前环境中安装的包。conda install&#xff1a;安装一个或多个包到当前环境中。conda uninstall&#xff1a;卸载一个或多个包从当前环境中。conda update&#xff1a;更新一…

论文解读:A New CNN Building Block for Low-ResolutionImages and Small Objects

引言 之前通过stride和pooling这些下采样操作&#xff0c;但是这些操作都会或多或少丢失图像的信息&#xff0c;所以这不适用于具有低分辨率图像和小物体的更困难的任务上。像池化选择maxpooling或者是averagepooling、卷积的步长(太大的话会丢失信息)都是很头疼的问题&#x…

I.MX6ULL开发笔记(二)——硬件外设操作

0x01 点亮第一个RGB灯 在文章http://t.csdnimg.cn/EGWt9中有介绍Linux下文件目录&#xff0c;那么在Linux系统下&#xff0c;RGB灯也是一个设备&#xff0c;所以我们需要到/sys目录下去操作这个设备。 之后&#xff0c;我们进入到class目录&#xff0c;这里挂载着开发板上的外…

Qt qDebug基本的使用方法详解

目录 qDebug基本用法输出字符串输出变量值1输出变量值2支持流式输出输出十六进制去除双引号和空格调试输出级别 自定义类型输出自定义日志信息的输出格式示例占位符设置环境变量 关闭QDebug输出Qt工程VS工程 在VS工程中如何查看qDebug输出 DebugView下载 qDebug基本用法 qDebug…

大学生如何当一个程序员——第三篇:热门专业学习之路1

第三篇&#xff1a;热门专业学习之路1 1.JAVASE2.数据库3.网页设计和开发4.Servlet/ JSP和企业级项目开发5.SSM框架&#xff08;Spring、Spring MVC、Mybatis&#xff09;6.各种JAVA新技术和大型项目的整合7.微服务架构8.一定要做一个大项目&#xff01; 各位小伙伴想要博客相关…

Python如何实现微信支付功能代码示例

微信支付是一种基于互联网的移动支付服务&#xff0c;由中国的即时通讯工具微信提供。用户可以通过微信支付在微信平台上进行在线支付、转账和收款。微信支付支持多种支付方式&#xff0c;包括银行卡支付、微信钱包余额支付、扫码支付等。用户可以用微信支付购买商品、支付账单…

SpringBoot Redis入门(一)——redis、Lettuce、Redisson使用

本章&#xff1a;将展示SpringBoot集成Redis三种客户端的配置要点和常见应用示例&#xff1b;下章&#xff1a;自行实现一个方法级的缓存注解&#xff0c;简化版的Cacheable&#xff0c;使初学者加深对Spring缓存框架的理解。 一、Lettuce客户端 Lettuce 是一种可扩展的、线程…

Ubuntun使用ISO镜像中的软件包作为本地镜像源

首先下载镜像&#xff1a; https://releases.ubuntu.com/jammy/ubuntu-22.04.3-desktop-amd64.iso 新建本地目录&#xff0c;挂载ISO文件到本地目录 sudo mkdir /media/cdrom sudo mount /mnt/e/iso/ubuntu-22.04.3-desktop-amd64.iso /media/cdrom # 备份镜像源 sudo mv…

Web前端篇——ElementUI的Backtop 不显示问题

在使用ElementUI的Backtop回到顶部组件时&#xff0c;单独复制这一行代码 <el-backtop :right"100" :bottom"100" /> 发现页面在向下滚动时&#xff0c;并未出现Backtop组件。 可从以下3个方向进行分析&#xff1a; 指定target属性&#xff0c;且…

Django文章标签推荐

当博客文章实现了标签后&#xff0c;可以用它们做很多有趣的事情。关于标签的更多内容&#xff0c;请看 Django集成第三方标签功能-CSDN博客 使用标签&#xff0c;我们可以很好地对博客文章进行分类。类似主题的帖子会有几个共同的标签。下一步将构建一个功能&#xff0c;以显…

pytest-yaml 测试平台-4.生成allure报告,报告反馈企业微信、钉钉、飞书通知

前言 定时任务执行完成后生成可视化allure报告&#xff0c;并把结果发到企业微信&#xff0c;钉钉&#xff0c;飞书通知群里。 生成allure报告 添加定时任务 执行完成后生成allure报告 查看报告详情 报告会显示详细的request 和 response 详细信息 也可以查看log日志 …

js中session、cookie、 localStorage和SessionStorage的区别和特点

在 JavaScript 中&#xff0c;session、cookie、localStorage 和 sessionStorage 是用于在客户端存储数据的不同机制。它们在以下几个方面有区别和特点&#xff1a; 1. 生命周期&#xff1a; - Session&#xff1a;session 存储在服务器端&#xff0c;通常使用会话标识符&a…