
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
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: true, restTime: 2000, needHover: false, delayTime: 3000, timingFunc: 'linear' | 配置项 |
Name | Type | Default | Description |
---|---|---|---|
moveTime | Number | 1000(单位:ms) | 滚动一个条目高度的过渡时间; |
needRestTime | Boolean | true | 每滚动一个条目,是否需要停顿;如果为false,restTime属性将无效; |
restTime | Number | 2000(单位:ms) | 每滚动一个条目后的停顿时间(尽量大于100,否则效果不好),needRestTime为true时,才有效; |
needHover | Boolean | true | 当鼠标移入和移出时,是否需要暂停和继续滚动; |
delayTime | Number | 3000(单位:ms) | 当滚动列表数据更新时,等待该延迟时间后,再进行滚动; |
timingFunc | String | 'linear' | 速度曲线【可选值: linear、ease、ease-in、ease-out、ease-in-out、cubic-bezier(n,n,n,n)】;当needRestTime为true时,才有效; |
优点:以像素作为滚动粒度,当鼠标移入暂停滚动时,能观察到这个优点;
缺点:性能相对差一些,因为为了效果流畅,定时器时间间隔较短;
优点:性能相对好一些,因为定时器时间间隔较长,transition性能较高;
缺点:以单个条目的高度为滚动粒度,当鼠标移入暂停滚动时,能观察到这个问题;
FAQs
A Vue.js project, (基于vue2的列表滚动插件)
The npm package vue-list-marquee receives a total of 3 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.