refactor(compiler-sfc): use shallowRef for ref sugar destructure

This commit is contained in:
Evan You
2021-08-04 15:39:23 -04:00
parent bc7dd93f92
commit bf2589b1f0
6 changed files with 35 additions and 35 deletions

View File

@@ -643,7 +643,7 @@ export function compileScript(
// append binding declarations after the parent statement
s.appendLeft(
statement.end! + startOffset,
`\nconst ${nameId.name} = ${helper('ref')}(__${nameId.name});`
`\nconst ${nameId.name} = ${helper('shallowRef')}(__${nameId.name});`
)
}
}
@@ -677,7 +677,7 @@ export function compileScript(
// append binding declarations after the parent statement
s.appendLeft(
statement.end! + startOffset,
`\nconst ${nameId.name} = ${helper('ref')}(__${nameId.name});`
`\nconst ${nameId.name} = ${helper('shallowRef')}(__${nameId.name});`
)
}
}