当前位置: 首页 > news >正文

vue:实现顶部消息横向滚动通知

前言

系统顶部展示一个横向滚动的消息通知,就是消息内容从右往左一直滚动。

效果如下:

代码

使用

<template><div class="notic-bar"><img :src="notic" class="notice-img" /><div class="notice-bar-container"><div class="notice-bar__wrap"><divv-for="(item, index) in list":key="index"class="notice-bar__wrap_text">{{ item }}</div></div></div></div>
</template><script setup lang="ts">
import notic from "../../public/notic.png";
const list = ["开发不易,感谢理解","","感谢您的理解","","您的支持是我继续完善的动力",
];
</script><style lang="scss" scoped>
.notic-bar {display: flex;background: #67c23a;margin: 5px;border-radius: 5px;padding: 2px 5px;
}
.notice-bar-container {display: flex;width: calc(100% - 30px);height: 20px;overflow: hidden;margin-left: 5px;
}
.notice-img {width: 20px;height: 20px;
}
.notice-bar__wrap {margin-left: 10px;display: flex;animation: move 20s linear infinite;line-height: 20px;color: #f5f6f7;.notice-bar__wrap_text {width: max-content;min-width: 100px;}
}
@keyframes move {0% {transform: translateX(100%);}100% {transform: translateX(-100%);}
}
</style>

http://www.lryc.cn/news/309792.html

相关文章:

  • [笔记] wsl 禁用配置 win系统环境变量+代理
  • Mysql标量子查询
  • 深入了解Java虚拟机(JVM)
  • Image Fusion via Vision-Language Model【文献阅读】
  • 探索Manticore Search:开源全文搜索引擎的强大功能
  • AI 笔记助手,你的思路整理助手
  • EchoServer回显服务器简单测试
  • 车灯修复UV胶的优缺点有哪些?
  • 探讨倒排索引Elasticsearch面试与实战:从理论到实践
  • 网安入门18-XSS(靶场实战)
  • 爬虫的一些小技巧总结
  • LeetCode---386周赛
  • React之数据绑定以及表单处理
  • Siamrpn++论文中文翻译(详细!)
  • 第一篇【传奇开心果系列】Python的自动化办公库技术点案例示例:深度解读Pandas库
  • 基于YOLOv8/YOLOv7/YOLOv6/YOLOv5的停车位检测系统(Python+PySide6界面+训练代码)
  • 状态模式(State Pattern)
  • js之版本号排序
  • 考取ORACLE数据库OCP的必要性 Oracle数据库
  • WordPress通过宝塔面板的入门安装教程【保姆级】
  • Leetcoder Day25| 回溯part05:子集+排列
  • 【HTML】HTML基础5(特殊字符)
  • MacBook将iPad和iPhone备份到移动硬盘
  • 贪心 Leetcode 376 摆动序列
  • 蓝桥杯(3.1)
  • 像用Excel一样用Python:pandasGUI
  • C#面:Application , Cookie 和 Session 会话有什么不同
  • BUUCTF---数据包中的线索1
  • 【数仓】kafka软件安装及集群配置
  • 代码随想录 二叉树第三周