效果跟vant组件中的NoticeBar一样。
html版:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
ul {
list-style: none;
width: 1320px;
position: relative;
}
* {
margin: 0;
padding: 0;
}
.box {
width: 320px;
border: 1px solid black;
overflow: hidden;
margin: 10px auto;
}
ul li {
width: 100px;
float: left;
background-color: blue;
margin-right: 10px;
}
</style>
</head>
<body>
<div class="box&

本文介绍如何在 Vue.js 中实现类似 vant 组件库的 NoticeBar 功能,包括 HTML 结构、组件封装及在 Vue 项目中的引用方法。
最低0.47元/天 解锁文章
3083

被折叠的 条评论
为什么被折叠?



