useCounter

useCounter

ユーティリティ関数を備えた基本的なカウンター。

基本的な使い方

import { useCounter } from '@vueuse/core'

const { count, inc, dec, set, reset } = useCounter()

オプションを使用した使い方

import { useCounter } from '@vueuse/core'

const { count, inc, dec, set, reset } = useCounter(1, { min: 0, max: 16 })