fix(compiler-sfc/reactivity-transform): fix edge case where normal script has ref macros but script setup does not

This commit is contained in:
Evan You
2022-01-21 08:47:48 +08:00
parent a05b000948
commit 4768f26f59
3 changed files with 45 additions and 14 deletions

View File

@@ -71,6 +71,23 @@ exports[`sfc ref transform usage in normal <script> 1`] = `
"
`;
exports[`sfc ref transform usage with normal <script> (has macro usage) + <script setup> (no macro usage) 1`] = `
"import { ref as _ref } from 'vue'
let data = _ref()
export default {
setup(__props, { expose }) {
expose();
console.log(data.value)
return { data }
}
}"
`;
exports[`sfc ref transform usage with normal <script> + <script setup> 1`] = `
"import { ref as _ref } from 'vue'