1.0.7 • Published 6 years ago

vue-svg-draw v1.0.7

Weekly downloads
18
License
MIT
Repository
-
Last release
6 years ago

vue-svg-draw vue vivus

这是一个封装了vivus功能的vue组件。
vivus是一款展示svg路径动画的js插件,不需要其它依赖库。

Build Setup

install dependencies

npm install vue-svg-draw --save

使用方法

import vueSvgDraw from 'vue-svg-draw'

注册组件

  components:{
    vueSvgDraw
  }

<vue-svg-draw file='/svg/2.svg' type="oneByOne" ref="vuesvg" :onReady="ready" pathTiming="EASE_OUT"></vue-svg-draw> this.$refs.vuesvg.stop()

options

PropertyTypeDefaultDescriptionValue
vivusIdstring'vivusId'元素id任意字符串
filestring无(必填)svg文件路径绝对路径
typestringdelayed定义使用哪一种动画类型delayed, async, oneByOne 或 script
durationinteger200动画的持续时间
startstringinViewport定义如何触发SVG动画inViewport,manual,autostart
dashGapinteger2dashes之间的空白间距默认值为2
forceRenderbooleantrue强制浏览器重新绘制所有的路径默认值为true,只在IE中有效
onReadyfunctionfunction(){}当实例在准备开始动画时调用
pathTimingstring'EASE'Timing animation function for each path element of the SVG'EASE' 'EASE_IN' 'EASE_OUT' 'EASE_OUT_BOUNCE'
animTimingstring'EASE'Timing animation function for the complete SVG'EASE' 'EASE_IN' 'EASE_OUT' 'EASE_OUT_BOUNCE'
callBackfunctionfunction(){}绘制后的回调function(){}

methods

  • stop()
  • reset()
  • play(speed,fun)
  • finish()
  • setFrameProgress(progress)
  • getStatus()
  • destroy()

demo

demo

相关链接

vivus

vivus 中文

svg在线制作

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago