Socket
Book a DemoInstallSign in
Socket

vue3-odometer-plus

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue3-odometer-plus

数字翻滚 number rolling odometer odometer-plus

0.2.2
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

vue3-odometer-plus

Install

pnpm add vue3-odometer-plus

Example

  • preview image:

  • ui

  • 简单的

<template>
    <button @click="updateValue()">update</button>
    <hr>
    <div class="test">
        <Vue3OdometerTs :value="count"></Vue3OdometerTs>
        <Vue3OdometerTs :value="count" animation="count"></Vue3OdometerTs>
    </div>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import Vue3OdometerTs from 'vue3-odometer-plus';

const count = ref(1000);
function updateValue() {
    count.value = Math.random() * 1200;
}
</script>

<style scoped>
.test {
    color: rgb(0, 137, 223);
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    gap: 20px;
}
</style>
  • odometer内置Style
<template>
    <div class="test">
        <button @click="updateValue()">update</button>
        <Vue3OdometerTs :value="count" theme="car"></Vue3OdometerTs>
        <hr>
        <Vue3OdometerTs :value="count" theme="digital"></Vue3OdometerTs>
        <hr>
        <Vue3OdometerTs :value="count" theme="minimal"></Vue3OdometerTs>
        <hr>
        <Vue3OdometerTs :value="count" theme="plaza"></Vue3OdometerTs>
        <hr>
        <Vue3OdometerTs :value="count" theme="slot-machine"></Vue3OdometerTs>
        <hr>
        <Vue3OdometerTs :value="count" theme="train-station"></Vue3OdometerTs>
    </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue';
import Vue3OdometerTs from 'vue3-odometer-plus';
// css 对应 template 中 的theme 按需引入即可
import 'odometer/themes/odometer-theme-car.css';
import 'odometer/themes/odometer-theme-digital.css';
import 'odometer/themes/odometer-theme-minimal.css';
import 'odometer/themes/odometer-theme-plaza.css';
import 'odometer/themes/odometer-theme-slot-machine.css';
import 'odometer/themes/odometer-theme-train-station.css';

const count = ref(1000);

function updateValue() {
    count.value = Math.random() * 1200;
}
</script>

<style scoped>
.test {
    color: rgb(0, 137, 223);
    font-size: 20px;
}
</style>
  • Props
type Props = {
    start?: number;
    value: number;
    /**
     * The format option allows you to configure how the digit groups are formatted, and how many digits are shown after the decimal point.
     @default '(d).dd'
     @example
        (,ddd)    -  12,345,678
        (,ddd).dd -  12,345,678.09
        (.ddd),dd -  12.345.678,09
        ( ddd),dd -  12 345 678,09
        d         -  12345678
     */
    format?: string;
    theme?: 'car' | 'default' | 'digital' | 'minimal' | 'plaza' | 'slot-machine' | 'train-station';
    formatFunction?: (v: number) => number;
    animation?: 'count' | 'default';
    /**
     * @default '.odometer'
     */
    selector?: string;
    /**
     * @default false
     */
    auto?: boolean;
    /**
     * @default 1000
     */
    duration?: number;
};

Keywords

数字翻滚

FAQs

Package last updated on 03 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.