From 179fc05a8406eac525c8450153b42fcb5af7d6bb Mon Sep 17 00:00:00 2001 From: Evan You Date: Sat, 11 Dec 2021 17:17:01 +0800 Subject: [PATCH] feat(reactivity-transform): support $-shorthands for all ref-creating APIs --- packages/ref-transform/src/refTransform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ref-transform/src/refTransform.ts b/packages/ref-transform/src/refTransform.ts index a3d50d91..a9972a2a 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 {