})"
`;
+exports[`defineProps > destructure without enabling reactive destructure 1`] = `
+"import { defineComponent as _defineComponent } from 'vue'
+
+export default /*#__PURE__*/_defineComponent({
+ props: {
+ foo: { type: null, required: true }
+ },
+ setup(__props: any, { expose: __expose }) {
+ __expose();
+
+const { foo } = __props;
+
+
+
+return { }
+}
+
+})"
+`;
+
exports[`defineProps > w/ TS assertion 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
})
})
+ // #8289
+ test('destructure without enabling reactive destructure', () => {
+ const { content } = compile(
+ `<script setup lang="ts">
+ const { foo } = defineProps<{
+ foo: Foo
+ }>()
+ </script>`
+ )
+ expect(content).toMatch(`const { foo } = __props`)
+ assertCode(content)
+ })
+
describe('errors', () => {
test('w/ both type and non-type args', () => {
expect(() => {
declId: ObjectPattern
) {
if (!ctx.options.propsDestructure && !ctx.options.reactivityTransform) {
+ ctx.propsIdentifier = ctx.getString(declId)
return
}