export default {
props: ['foo'],
setup(__props) {
-const __props_bar = _toRef(__props, 'bar')
-const __props_foo = _toRef(__props, 'foo')
+const __props_bar = _toRef(__props, 'bar');
+const __props_foo = _toRef(__props, 'foo');
console.log((__props_foo))
props: ['foo', 'bar', 'baz'],
setup(__props) {
-const rest = _createPropsRestProxy(__props, [\\"foo\\",\\"bar\\"])
+const rest = _createPropsRestProxy(__props, [\\"foo\\",\\"bar\\"]);
let n = _ref(1), __$temp_1 = (useFoo()),
a = _toRef(__$temp_1, 0),
- b = _toRef(__$temp_1, 1, 1)
+ b = _toRef(__$temp_1, 1, 1);
console.log(n.value, a.value, b.value)
"
`;
let a = _ref(1)
const __$temp_1 = (useMouse()),
x = _toRef(__$temp_1, 'x'),
- y = _toRef(__$temp_1, 'y')
+ y = _toRef(__$temp_1, 'y');
"
`;
"import { toRef as _toRef } from 'vue'
let __$temp_1 = (useFoo()),
- b = _toRef(__$temp_1[0].a, 'b')
+ b = _toRef(__$temp_1[0].a, 'b');
let __$temp_2 = (useBar()),
d = _toRef(__$temp_2.c, 0),
- e = _toRef(__$temp_2.c, 1)
+ e = _toRef(__$temp_2.c, 1);
console.log(b.value, d.value, e.value)
"
`;
c = _toRef(__$temp_1, 'b'),
d = _toRef(__$temp_1, 'd', 1),
f = _toRef(__$temp_1, 'e', 2),
- h = _toRef(__$temp_1, g)
+ h = _toRef(__$temp_1, g);
let __$temp_2 = (useSomething(() => 1)),
- foo = _toRef(__$temp_2, 'foo');
+ foo = _toRef(__$temp_2, 'foo');;
console.log(n.value, a.value, c.value, d.value, f.value, h.value, foo.value)
"
`;
"import { toRef as _toRef } from 'vue'
const __$temp_1 = (useFoo()),
- b = _toRef((__$temp_1.a || { b: 123 }), 'b')
+ b = _toRef((__$temp_1.a || { b: 123 }), 'b');
console.log(b.value)
"
`;
s.overwrite(pattern.start! + offset, pattern.end! + offset, tempVar)
}
+ let nameId: Identifier | undefined
for (const p of pattern.properties) {
- let nameId: Identifier | undefined
let key: Expression | string | undefined
let defaultValue: Expression | undefined
if (p.type === 'ObjectProperty') {
)
}
}
+ if (nameId) {
+ s.appendLeft(call.end! + offset, ';')
+ }
}
function processRefArrayPattern(
s.overwrite(pattern.start! + offset, pattern.end! + offset, tempVar)
}
+ let nameId: Identifier | undefined
for (let i = 0; i < pattern.elements.length; i++) {
const e = pattern.elements[i]
if (!e) continue
- let nameId: Identifier | undefined
let defaultValue: Expression | undefined
if (e.type === 'Identifier') {
// [a] --> [__a]
)
}
}
+ if (nameId) {
+ s.appendLeft(call.end! + offset, ';')
+ }
}
type PathSegmentAtom = Expression | string | number
offset,
`const __props_${publicKey} = ${helper(
`toRef`
- )}(__props, '${publicKey}')\n`
+ )}(__props, '${publicKey}');\n`
)
}
}