From: Evan You Date: Sat, 11 Dec 2021 09:17:01 +0000 (+0800) Subject: feat(reactivity-transform): support $-shorthands for all ref-creating APIs X-Git-Tag: v3.2.25~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=179fc05a8406eac525c8450153b42fcb5af7d6bb;p=thirdparty%2Fvuejs%2Fcore.git feat(reactivity-transform): support $-shorthands for all ref-creating APIs --- diff --git a/packages/ref-transform/src/refTransform.ts b/packages/ref-transform/src/refTransform.ts index a3d50d918b..a9972a2a2e 100644 --- a/packages/ref-transform/src/refTransform.ts +++ b/packages/ref-transform/src/refTransform.ts @@ -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 {