Skip to content

get

类别
导出体积
117 B
上次更改
5 days ago

用于访问 ref.value 的简写方式

用法

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

const a = ref(42)

console.log(get(a)) // 42

类型声明

typescript
/**
 * 访问 `ref.value` 的简写方式
 */
export declare function get<T>(ref: MaybeRef<T>): T
export declare function get<T, K extends keyof T>(
  ref: MaybeRef<T>,
  key: K,
): T[K]

源码

源码文档

贡献者

Anthony Fu
一纸忘忧
Anthony Fu
Robin

更新日志

c1d6e - feat(shared): ensure return types exists (#4659)
0a9ed - feat!: drop Vue 2 support, optimize bundles and clean up (#4349)