Skip to content

toRef

Category
Last Changed
7月25日16时53分

Normalize value/ref/getter to ref or computed.

Usage

ts
import { toRef } from 'comuse-core'

const foo = ref('hi')

const a = toRef(0) // Ref<number>
const b = toRef(foo) // Ref<string>
const c = toRef(() => 'hi') // ComputedRef<string>

Source

SourceDocs

Changelog

v4.1.0 on 8/1/2025
ffe0c - feat: add useQRCode and useVSConsle

Released under the MIT License.