主题
useToString
反应式性地将引用转换为字符串。
¥Reactively convert a ref to string.
用法
¥Usage
ts
import { useToString } from '@vueuse/core'
const number = ref(3.14)
const str = useToString(number)
str.value // '3.14'
类型声明
typescript
/**
* Reactively convert a ref to string.
*
* @see https://vueuse.org/useToString
*/
export declare function useToString(
value: MaybeRefOrGetter<unknown>,
): ComputedRef<string>