feat(reactivity-transform): support $-shorthands for all ref-creating APIs

This commit is contained in:
Evan You 2021-12-11 17:17:01 +08:00
parent 93ba6b974e
commit 179fc05a84

View File

@ -24,7 +24,7 @@ import { hasOwn, isArray, isString } from '@vue/shared'
const TO_VAR_SYMBOL = '$'
const TO_REF_SYMBOL = '$$'
const shorthands = ['ref', 'computed', 'shallowRef']
const shorthands = ['ref', 'computed', 'shallowRef', 'toRef', 'customRef']
const transformCheckRE = /[^\w]\$(?:\$|ref|computed|shallowRef)?\s*(\(|\<)/
export function shouldTransform(src: string): boolean {