Giter Site home page Giter Site logo

tween-number's Introduction

tween-number

数字缓动

属性

属性 描述 类型 默认值
value 结束值 Number 0
startVal 初始值 Number 0
duration 动画间隔(单位毫秒) Number 1000
prefix 前缀 String ''
suffix 后缀 String ''
decimals 保留小数点后几位数字 Number 0
ease 缓动效果(可选值:'Linear', 'CubicIn','CubicIn','CubicInOut') String 'Linear'
format 结果格式化(String格式可填写'money' 'time') String, Function
timeLayout 时间格式化模板(仅对format='time'有效) String 'hh:mm:ss'

使用

安装

npm install tween-number --save-dev

引用

<template>
    <tween-number v-model="number" :decimals="2"/>
    <tween-number suffix="%" v-model="progress" :startVal="progressStart" :duration="300"/>
</template>

<script>
  import tweenNumber from 'tween-number';
  export default {
    components: { tweenNumber },
    data () {
      return {
        number: 123455,
        progressStart: 0,
        progress: 100
      }
    }
  }
</script>

示例

在线查看示例 查看示例代码

tween-number's People

Contributors

phoebecodespace avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.