New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

vue-notice-bar

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-notice-bar

a notice-bar component for Vue2.0

latest
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

vue-notice-bar

Version License Downloads

a notice-bar component for Vue2.0

Install

use npm:

  npm i -S vue-notice-bar

Usage

Like most of the Vue-Plugin:

  import Vue from 'vue'
  import NoticeBar from './lib'
  Vue.use(NoticeBar)

Then, use in your component:

  <notice-bar
    :text="msg"
    icon="http://o8sux93eg.bkt.clouddn.com/notice.png"
    :speed="30"
    :callback="handleAnimationEnd">
  </notice-bar>
  export default {
    name: 'app',
    components: {
      NoticeBar
    },
    data () {
      return {
        list: [
          '世界杯就要开始啦!',
          '德国、葡萄牙、阿根廷、西班牙相继出局',
          '巴西2:0淘汰墨西哥,日本竟然破了两次比利时的球门,虽败犹荣。',
          '这次到底谁才能成功捧起大力神杯呢?'
        ],
        msg: ''
      }
    },
    created () {
      this.index = 0
      this.msg = this.list[0]
    },
    methods: {
      handleAnimationEnd () {
        // update autoscroll content at the right time
        this.msg = this.list[++this.index]
        if (this.index === this.list.length - 1) {
          this.index = -1
        }
      }
    }
  }

效果部分截图

API

propNameTypeRequiredDefault
colorStringfalse#FFF
backgroundColorStringfalse#F60
iconStringfalse''
textStringtrue--
speedNumberfalse40
delayNumberfalse1 (s)
callbackFunctionfalse--

Development

  # for dev
  npm run dev

Keywords

vue

FAQs

Package last updated on 03 Jul 2018

Did you know?

Socket

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.

Install

Related posts