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

vue-easy-notice-bar

v1.1.2

Published

Vue.js 2+ notice-bar plugin

Downloads

7

Readme

VueEasyNoticeBar 使用简单的Vue通告栏组件

使用指南

安装

NPM
npm i vue-easy-notice-bar -S 
YARN
yarn add vue-easy-notice-bar

全局插件

import { NoticeBar } from 'vue-easy-notice-bar'

Vue.use(NoticeBar);

单文件引入

import NoticeBar from 'vue-easy-notice-bar'

export default {
  ...
  components: {
    NoticeBar
  }
  ...
}

代码演示

基础用法

<notice-bar
  :text="'今天天气多云转晴'"
  :bg-color="'#fff'"
  :color="'#03a9f4'"
  left-icon="http://o9kkuebr4.bkt.clouddn.com/notice-color.png"
/>

垂直滚动模式

默认模式为水平滚动,组件NoticeBarVertical为垂直方向滚动,此组件text属性必须为数组。

import { NoticeBarVertical } from 'vue-easy-notice-bar'

export default {
  ...
  components: {
    NoticeBarVertical
  }
  ...
}
<notice-bar-vertical
  :text="[
    '重启,可以解决电脑百分之七十的问题。',
    '重装系统,可以解决百分之八十的问题。',
    '换个电脑,可以解决百分之九十的问题。',
    '解决掉提出bug的人,可以解决百分之一百的问题。'
  ]"
  bg-color="#ffdca9"
  color="#b36f0c"/>

NoticeBarVertical还支持3D视觉滚动

<notice-bar-vertical
  :text="[
    '重启,可以解决电脑百分之七十的问题。',
    '重装系统,可以解决百分之八十的问题。',
    '换个电脑,可以解决百分之九十的问题。',
    '解决掉提出bug的人,可以解决百分之一百的问题。'
  ]"
  three-d
  bg-color="#ffdca9"
  color="#b36f0c"/>

API

| 参数 | 说明 | 类型 | 默认值 | |-----------|-----------|-----------|-------------| | text | 通告栏文字 | String、Array | '' | | vertical | 滚动方向是否为垂直 | Boolean | false | | bg-img | 背景图片 URL | String | - | | left-icon | 左侧图标图片 URL | String | - | | color | 文本颜色 | String | #fff | | bg-color | 滚动条背景 | String | #03a9f4 | | speed | 滚动速度(px/s) | Number | 50 | | duration | 滚动时间(ms),NoticeBarVertical下最大值为interval | Number | - | | delay | 动画延迟时间(ms) | Number | 1000 | | outview | 是否从视野外开始滚动 | Boolean | false | | scrollable | 是否禁止动画 | Boolean | true | | mode | 通告栏模式,可选值:right、close | String | - | | interval | 垂直滚动的动画间隔(ms),仅NoticeBarVertical支持 | Number | 3000 | | three-d | 垂直滚动3d视觉模式,仅NoticeBarVertical支持 | Boolean | false |

Event

| 事件名 | 说明 | 参数 | |-----------|-----------|-----------| | click | 点击事件回调 | - |

TODO

  • [x] 添加默认icon
  • [ ] 自定义icon
  • [x] 可显示右箭头
  • [x] 添加关闭功能和按钮
  • [x] 禁用滚动属性
  • [x] 分离水平滚动和垂直滚动组件,提取mixin
  • [x] 3D垂直翻转
  • [ ] 手势滑动
  • [ ] 鼠标悬停滚动暂停