
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
vue-list-marquee
Advanced tools
基于vue2的列表滚动插件
特点1:滚动方向,自下而上(目前,滚动方向不可自定义);
特点2:当列表内容超过列表高度,自动滚动,否则,不滚动;
特点3:如果滚动,则首尾无缝拼接;
npm install vue-list-marquee --save
import Vue from 'vue'
// require styles
import 'vue-list-marquee/dist/vue-list-marquee.css'
import VueListMarquee from 'vue-list-marquee'
Vue.use(VueListMarquee)
// require styles
import 'vue-list-marquee/dist/vue-list-marquee.css'
import { VueListMarquee } from 'vue-list-marquee'
export default {
components: {
VueListMarquee
}
}
<vue-list-marquee class='my-marquee' :listData='myList' :option='myOption'>
<template slot-scope="{ item, index }">
<!-- 每一条内容的结构 -->
<div class="list-item">
<div class='col1'>-{{index}}-</div>
<div class='col2' :title="item.content">{{item.content}}</div>
</div>
</template>
</vue-list-marquee>
https://github.com/hz-ljq/vue-list-marquee/blob/master/src/components/Demo.vue
Name | Type | Default | Description |
---|---|---|---|
:listData | Array | [] | 列表内容数组 |
:option | Object | moveTime: 1000, needRestTime: false, restTime: 2000, needHover: false, delayTime: 3000 | 配置项 |
Name | Type | Default | Description |
---|---|---|---|
moveTime | Number | 1000(单位:ms) | 滚动一个条目高度的过渡时间; |
needRestTime | Boolean | false | 每滚动一个条目,是否需要停顿;如果为false,restTime属性将无效; |
restTime | Number | 2000(单位:ms) | 每滚动一个条目后的停顿时间(尽量大于100,否则效果不好),needRestTime为true时,才有效; |
needHover | Boolean | true | 当鼠标移入和移出时,是否需要暂停和继续滚动; |
delayTime | Number | 3000(单位:ms) | 当滚动列表数据更新时,等待该延迟时间后,再进行滚动; |
优点:以像素作为滚动粒度,当鼠标移入暂停滚动时,能观察到这个优点;
缺点:性能相对差一些,因为为了效果流畅,定时器时间间隔较短;
优点:性能相对好一些,因为定时器时间间隔较长,transition性能较高;
缺点:以单个条目的高度为滚动粒度,当鼠标移入暂停滚动时,能观察到这个问题;
FAQs
A Vue.js project, (基于vue2的列表滚动插件)
The npm package vue-list-marquee receives a total of 11 weekly downloads. As such, vue-list-marquee popularity was classified as not popular.
We found that vue-list-marquee demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.