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

taro-marquee

v0.0.5

Published

taro3 react marquee

Downloads

1

Readme

Taro3好用的跑马灯条

ezgif.com-gif-maker.gif

安装

yarn add taro-marquee

使用

import Broadcast from 'taro3-marquee'
...
<Broadcast
    infoStr={'测试文案'}
/>
...

模式

重建模式(默认)

通过一个变量,频繁的进行挂载和卸载。

import Broadcast,{ BROADCAST_REBUILD } from 'taro3-marquee'

export default () => {
  const [flag, setFlag] = useState(); // flag 为true就显示

  return (
    <View
      onClick={() => {
        setFlag(!flag);
      }}
    >
      {flag && <Broadcast mode={BROADCAST_REBUILD} nfoStr={"测试文案"} />}
    </View>
  );
};

常驻模式

简单讲就是组件不通过变量进行频繁的挂载和卸载,仅仅通过样式进行显示和隐藏。

import Broadcast,{ BROADCAST_LIVE } from 'taro3-marquee'

export default () => {
  const [falg, setFlag] = useState(); // flag 为true就显示
  return (
    <View
      onClick={() => {
        setFlag(!flag);
      }}
    >
      <View
        style={{
          visibility: flag ? "" : "hidden",
        }}
      >
        <Broadcast
          mode={BROADCAST_LIVE} // 模式
          isRest={flag} // isRest用来触发组件的重置刷新
          infoStr={"测试文案"}
        />
      </View>
    </View>
  );
};

配置项一览

  • mode 组件的存在模式

    • BROADCAST_REBUILD(默认):频繁的销毁重建。
    • BROADCAST_LIVE:组件常驻,仅仅通过样式进行显示隐藏。
  • isReset 重置开关

    • 作用:主动控制组件的重置刷新。
    • 注意:仅当模式为BROADCAST_LIVE时有效。
  • infoStr 显示的文本信息。

  • bgColor 跑马灯背景板颜色。

    • 默认: #FEF6EAFF
  • fontColor: 字体颜色

    • 默认:"#FF8800FF",
  • fontSize 字体大小,根据该值进行留白计算,

    • 默认:"12px",
  • startPercent 跑马灯文本起步的位置(比例),

    • 默认:0.5 也就是从中心位置开始