]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
feat(reactivity-transform): support $-shorthands for all ref-creating APIs
authorEvan You <yyx990803@gmail.com>
Sat, 11 Dec 2021 09:17:01 +0000 (17:17 +0800)
committerEvan You <yyx990803@gmail.com>
Sat, 11 Dec 2021 09:17:01 +0000 (17:17 +0800)
packages/ref-transform/src/refTransform.ts

index a3d50d918b060180013cb7cf66addf32493ec4dc..a9972a2a2e9863f09fd1d777ee67aa5e385f5b61 100644 (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 {