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'
类型声明
typescript
/**
* 获取值、ref 或 getter 的值。
*
* @deprecated use `toValue` from `vue` instead
*/
export declare const toValue: typeof _toValue
/**
* @deprecated use `toValue` instead
*/
export declare const resolveUnref: typeof _toValue