feat(sfc): support $shallowRef ref sugar

This commit is contained in:
Evan You
2021-08-11 10:19:58 -04:00
parent e42d7794cb
commit 00b76d3dc1
7 changed files with 46 additions and 20 deletions

View File

@@ -33,8 +33,8 @@ return { a, b, c }
}"
`;
exports[`<script setup> ref sugar $ref declarations 1`] = `
"import { ref as _ref } from 'vue'
exports[`<script setup> ref sugar $ref & $shallowRef declarations 1`] = `
"import { ref as _ref, shallowRef as _shallowRef } from 'vue'
export default {
setup(__props, { expose }) {
@@ -42,7 +42,7 @@ export default {
let foo = _ref()
let a = _ref(1)
let b = _ref({
let b = _shallowRef({
count: 0
})
let c = () => {}