【vue】vue跑马灯vue-marquee-text-component

vue2

npm install [email protected]

vue3

npm install vue-marquee-text-component

安装完成之后,vue页面全局引入

import Vue from 'vue'
import MarqueeText from 'vue-marquee-text-component'

Vue.component('marquee-text', MarqueeText)

页面引入

import MarqueeText from 'vue-marquee-text-component'

export default {
  name: 'HelloWorld',
  components: {
    MarqueeText
  }
}

例子:



  Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna.




  Short text =(




  Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna.

props

Prop

Type Default Description
duration Number 15 Animation Duration
repeat Number 2 Number of repeat the Slot (It's important for to short content)
paused Boolean false The property specifies whether the animation is running or paused
reverse Boolean false

Set animation-direction to reverse



  {{ currentTrack.title }}

你可能感兴趣的:(vue.js,javascript,前端)