feat(experimental): shouldTransform for ref-transform
This commit is contained in:
@@ -24,6 +24,11 @@ import { babelParserDefaultPlugins } from '@vue/shared'
|
||||
const TO_VAR_SYMBOL = '$'
|
||||
const TO_REF_SYMBOL = '$$'
|
||||
const shorthands = ['ref', 'computed', 'shallowRef']
|
||||
const transformCheckRE = /[^\w]\$(?:\$|ref|computed|shallowRef)?\(/
|
||||
|
||||
export function shouldTransform(src: string): boolean {
|
||||
return transformCheckRE.test(src)
|
||||
}
|
||||
|
||||
export interface ReactiveDeclarator {
|
||||
node: VariableDeclarator
|
||||
|
||||
Reference in New Issue
Block a user