New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

vue-danmuku

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

vue-danmuku

一个弹幕组件

unpublished
latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

vue-danmaku

一个Vue弹幕组件

Install

npm install vue-danmaku --save

Usage

<vue-danmaku ref="danmaku" :danmus="danmus" :config="config" @inited="onInit">
  <slot></slot>
</vue-danmaku>
import vueDanmaku from 'vue-danmaku'

data() {
  return {
    danmus: ['danmu1', 'danmu2', 'danmu3', 'danmu4', '...']
    config: {
      channels: 5,
      loop: true
    }
  }
}

Attributes

参数说明类型可选值默认值
channels轨道数量[Number]容器可容纳最高轨道数
loop是否开启循环[Boolean]false
speed弹幕速度,值越大弹幕越慢[Number]5

Events

事件名称说明回调参数
inited弹幕初始化完毕,准备就绪null
mousein鼠标移入弹幕容器null
mouseout鼠标移出弹幕容器null

Methods

方法名说明参数
draw开始弹幕滚动
stop停止弹幕滚动
pause暂停弹幕滚动

TODO

[] 弹幕暂停 [] 插入弹幕(按百分比插入,从头插入,从尾插入) [] 弹幕颜色 [] 弹幕透明度

FAQs

Package last updated on 04 Mar 2018

Related posts