# vue-marquee-component

> Vue跑马灯组件,支持四个方向滚动

Latest version **1.0.0** (published 2020-04-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install vue-marquee-component
pnpm add vue-marquee-component
yarn add vue-marquee-component
bun add vue-marquee-component
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-04-11 |
| First published | 2020-04-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 2.2 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 68 |
| Author | WuXiaohong |
| Maintainers | wxh16144 |
| Keywords | vue, vuejs, vue2, vuejs2, vue-component, marquee, vue-marquee, component |

## Links

- npm: https://www.npmjs.com/package/vue-marquee-component
- Repository: https://github.com/Wxh16144/vue-marquee-component
- Homepage: https://github.com/Wxh16144/vue-marquee-component#readme
- Issues: https://github.com/Wxh16144/vue-marquee-component/issues
- npm.io page: https://npm.io/package/vue-marquee-component

## Dependencies (5)

- [vue](https://npm.io/package/vue.md) ^2.6.11
- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [animejs](https://npm.io/package/animejs.md) ^3.2.0
- [core-js](https://npm.io/package/core-js.md) ^3.6.4
- [vue-slider-component](https://npm.io/package/vue-slider-component.md) ^3.1.1

## Recent versions

- 1.0.0 (latest) — 2020-04-11
- 0.1.0-beta.2 — 2020-04-11
- 0.1.0-beta.1 — 2020-04-10

## README

# vue-marquee-component

[![npm](https://img.shields.io/npm/v/vue-marquee-component.svg?style=for-the-badge)](https://www.npmjs.com/package/vue-marquee-component)
[![npm](https://img.shields.io/npm/dt/vue-marquee-component.svg?style=for-the-badge)](https://www.npmjs.com/package/vue-marquee-component)


## Demo

[Demo here](https://wxh16144.github.io/vue-marquee-component/)


## Install

```bash
  npm install vue-marquee-component --save
```

## Usage

The most common use case is to register the component globally.

```js
// in your main.js or similar file
import Vue from 'vue'
import VueMarquee from 'vue-marquee-component'

Vue.use(VueMarquee)
```

Alternatively you can do this to register the components:

```js
// HelloWorld.vue
import { Marquee, Slide } from "vue-marquee-component"

export default {
  components: {
    [Marquee.name]: Marquee,
    [Slide.name]: Slide
  }
}
```

On your page you can now use html like this:

```html
<!-- simple marquee text -->
<vue-marquee style="height:50px">
  <vue-marquee-slide v-for="i in 30" :key="i">
    <span> VUE-MARQUEE-COMPONENT </span>
  </vue-marquee-slide>
</vue-marquee>

<!-- Set different directions -->
<!-- left 、 right 、 top 、bottom  -->
<vue-marquee style="height:150px" direction="right">
  <vue-marquee-slide v-for="i in 30" :key="i">
    <div style="width:200px;height:150px">{{ i }}</div>
  </vue-marquee-slide>
</vue-marquee>

<!-- Hide scrollbar -->
<vue-marquee style="height:28px" :showProgress="false">
  <vue-marquee-slide v-for="i in 30" :key="i">
    <span> VUE-MARQUEE-COMPONENT </span>
  </vue-marquee-slide>
</vue-marquee>

<!-- fast duration -->
<vue-marquee style="height:28px" :showProgress="false" :duration="52011">
  <vue-marquee-slide v-for="i in 99" :key="i">
    <span style="padding:0 15px"> 👧 ❤️ 👦 </span>
  </vue-marquee-slide>
</vue-marquee>

<!-- Insert any node -->
<vue-marquee>
  <vue-marquee-slide v-for="item in list" :key="item.id">
    <!-- The component you want to display -->
  </vue-marquee-slide>
</vue-marquee>
```

## Props
| Prop         | Type    | Default           | Description                                        |
| ------------ | ------- | ----------------- | -------------------------------------------------- |
| direction    | string  | left              | Marquee rolling direction                          |
| duration     | Number  | Total length * 30 | Move a few degrees (`left` `right` `top` `bottom`) |
| showProgress | Boolean | true              | Whether to show the progress bar                   |

## Important information for dynamic content
If you change the content you need reload the component. For this use property `:key` [see more](https://vuejs.org/v2/api/#key)
```html
<!-- parse a unique key for reload the component  -->
<vue-marquee :key="currentTrack.id">
  <vue-marquee-slide>
    {{ currentTrack.title }}
  </vue-marquee-slide>
</vue-marquee>
```

---
_Source: https://npm.io/package/vue-marquee-component · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
