toValue
获取值/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