npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rs-light

v1.0.3

Published

基于vue 2.x的一个字符串跑马灯组件

Downloads

18

Readme

rs-light

基于vue 2.x的一个字符串模拟rs尾灯效果,可配置成跑马灯

组件: rs-light

版本: 1.0.3

使用方法

  • 通过NPM下载安装
	npm install rs-light --save

在vue页面中引入 并在componets中声明该组件

  • xxx.vue
<template>
	<div class="rsLightDemo">
		<rs-light string="rslightdemo"></rs-light>
	</div>
</template>

<script>
import RsLight from 'rs-light'; // 引入
export default {
	components: { RsLight }
}
</script>

配置参数

| 参数 | 说明 | 类型 | 默认值 | | - | :- | :- | :- | | string | 传入的字符串 | String | 无默认值,必传 | | during | 动画持续时间 | Number | 默认一秒闪动两个字符 | | light | 高亮的颜色 | String | '#000' | | dark | 常规颜色 | String | 'transparent' | | className | 主体的class | String | - | | itemClassName | 每一个字符的class | String | - | | direction | 动画方向(forward/reverse) | String | 'forward' | | indexClass | 根据特殊下标控制某个字符的class | Object | - | | infinite | 是否无限重复,动画播放次数 | String/Number/Boolean | 1 | | marquee | 开启跑马灯效果 | Boolean | false |

注:

  • 可以通过className和itemClassName为整个字符串和每个字符添加class,通过class改变样式;
  • 通过indexClass为字符串中特定的一个字符添加class,可以是数组类型,(例['largeText', 'miniText'],数组的第n个值便是第n个字符的class;)或是对象类型(例: {3: 'miniText'},key:为第n个字符,value为特定class);
  • direction的默认值forward为从右向左,想要反向请使用 reverse;
  • marquee默认为false,参考的是奥迪rs的尾灯效果;为true时为跑马灯效果,跑马灯效果需调试一下dark、during、infinite参数,以达到更好效果;