|
|
@@ -265,6 +265,27 @@ describe('sfc reactive props destructure', () => {
|
|
|
})
|
|
|
})
|
|
|
|
|
|
+ test('rest spread non-inline', () => {
|
|
|
+ const { content, bindings } = compile(
|
|
|
+ `
|
|
|
+ <script setup>
|
|
|
+ const { foo, ...rest } = defineProps(['foo', 'bar'])
|
|
|
+ </script>
|
|
|
+ <template>{{ rest.bar }}</template>
|
|
|
+ `,
|
|
|
+ { inlineTemplate: false },
|
|
|
+ )
|
|
|
+ expect(content).toMatch(
|
|
|
+ `const rest = _createPropsRestProxy(__props, ["foo"])`,
|
|
|
+ )
|
|
|
+ assertCode(content)
|
|
|
+ expect(bindings).toStrictEqual({
|
|
|
+ foo: BindingTypes.PROPS,
|
|
|
+ bar: BindingTypes.PROPS,
|
|
|
+ rest: BindingTypes.SETUP_REACTIVE_CONST,
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
// #6960
|
|
|
test('computed static key', () => {
|
|
|
const { content, bindings } = compile(`
|