Skip to content

tracy2zhang/vue-rotate

Repository files navigation

vue-rotate

A Vue.js rotate component

安装

  npm install vue-rotate -S

使用

<rotate ref="rotate" :rotating="isRotating"></rotate>
import Rotate from 'vue-rotate'
...
export default {
  data () {
    return {
      isRotating: true
    }
  },
  components: {
    Rotate
  }
}
...

props

rotating (是否转动)

Type: Boolean
Required: false
Default: false

dps (转速degree per second)

Type: Number
Required: false
Default: 10

methods

play 开始旋转

this.$refs.rotate.play()

pause 停止旋转

this.$refs.rotate.pause()

reset 重置

this.$refs.rotate.reset()