Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wxh16144/vue-marquee-component

Vue跑马灯组件,支持四个方向滚动
https://github.com/wxh16144/vue-marquee-component

Last synced: about 1 month ago
JSON representation

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

Awesome Lists containing this project

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


VUE-MARQUEE-COMPONENT


{{ i }}


VUE-MARQUEE-COMPONENT


👧 ❤️ 👦



```

## Props

| Prop | Type | Default | Description |
| ------------ | ------- | ------------------ | -------------------------------------------------- |
| direction | string | left | Move a few degrees (`left` `right` `top` `bottom`) |
| duration | Number | Total length \* 30 | Marquee rolling direction |
| 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


{{ currentTrack.title }}

```