Skip to content

toValue

Category
Export Size
106 B
Last Changed
3 hours ago
Alias
resolveUnref
Related

获取值/ref/getter 的值。

WARNING

已弃用,请使用 import { toValue } from 'vue' 代替。

用法

ts
import { toValue } from '@vueuse/core'

const foo = ref('hi')

const a = toValue(0) // 0
const b = toValue(foo) // 'hi'
const c = toValue(() => 'hi') // 'hi'

Type Declarations

typescript
/**
 * Get the value of value/ref/getter.
 *
 * @deprecated use `toValue` from `vue` instead
 */
export declare const toValue: typeof _toValue
/**
 * @deprecated use `toValue` instead
 */
export declare const resolveUnref: typeof _toValue

Source

SourceDocs

Contributors

jorshen

Changelog

No recent changes

Released under the MIT License.