Skip to content

一个基于vue&vue-digital-transform的数值波动效果组件

Notifications You must be signed in to change notification settings

zym163/vue-fluctuation

 
 

Repository files navigation

vue-fluctuation

一个基于vue&vue-digital-transform的数值波动效果组件

Demo

vue-fluctuation

Install

npm install @findsoft/vue-fluctuation

Quick Start

<template>
<fluctuation :value="value" 
             :seperator="isSep"
             :unit="unit"                       
             :interval="interval"
>
    <template>
        <i>可以选择插入以i标签包裹的icon</i>
    </template>
</fluctuation>
</template>
import Fluctuation from "vue-fluctuation";

export default {
  components: {
    Fluctuation
  },
  data() {
    return {
      value: 666666,
      isSep: false,
      unit: '个',
      interval: 1000
    };
  }
};

Slot

可以选择插入一个icon,以i标签包裹,自带默认样式

<fluctuation :value="value">
    <template>
        <i>可以选择插入以i标签包裹的icon</i>
    </template>
</fluctuation>

Props

prop type description default
value Number 需要监听数值波动的值 0
separator Boolean 是否开启千分位分隔符 false
unit String 数值单位,可以是任何你认为正确的单位 ''
interval Number 数字滚动过渡时间(ms) 500

About

一个基于vue&vue-digital-transform的数值波动效果组件

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vue 55.0%
  • CSS 38.3%
  • JavaScript 4.4%
  • HTML 2.3%