This repository was archived by the owner on Dec 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +39
-5
lines changed Expand file tree Collapse file tree 3 files changed +39
-5
lines changed Original file line number Diff line number Diff line change @@ -220,9 +220,6 @@ export function applyMacros(nodes: Statement[]) {
220220
221221 return t . objectExpression (
222222 Object . entries ( props ) . map ( ( [ key , value ] ) => {
223- if ( value . type === 'null' )
224- return t . objectProperty ( t . identifier ( key ) , t . nullLiteral ( ) )
225-
226223 const prop = hasStaticDefaults
227224 ? ( propsRuntimeDefaults as ObjectExpression ) . properties . find ( ( node : any ) => node . key . name === key ) as ObjectProperty
228225 : undefined
Original file line number Diff line number Diff line change @@ -369,7 +369,11 @@ __sfc_main.props = {
369369 required: false ,
370370 type: Array
371371 },
372- any : null
372+ any : {
373+ key: \\" any\\ " ,
374+ required: true ,
375+ type: null
376+ }
373377} ;
374378
375379__sfc_main.setup = (__props, __ctx) => {
@@ -426,6 +430,28 @@ export default __sfc_main;
426430"
427431`;
428432
433+ exports[`transform fixtures test/fixtures/MacrosType4.vue 1`] = `
434+ " <script lang =\\"ts\\">
435+ type Test = number[];
436+ const __sfc_main = { } ;
437+ __sfc_main.props = {
438+ test : {
439+ key: \\" test\\ " ,
440+ required: false ,
441+ type: null ,
442+ default : () => []
443+ }
444+ } ;
445+
446+ __sfc_main.setup = (__props, __ctx) => {
447+ return {};
448+ } ;
449+
450+ export default __sfc_main;
451+ </script>
452+ "
453+ `;
454+
429455exports[`transform fixtures test/fixtures/MacrosTypeAny.vue 1`] = `
430456" <template>
431457 <div>
@@ -436,7 +462,11 @@ exports[`transform fixtures test/fixtures/MacrosTypeAny.vue 1`] = `
436462<script lang =\\"ts\\">
437463const __sfc_main = { } ;
438464__sfc_main.props = {
439- value : null
465+ value : {
466+ key: \\" value\\ " ,
467+ required: true ,
468+ type: null
469+ }
440470} ;
441471
442472__sfc_main.setup = (__props, __ctx) => {
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ type Test = number []
3+ withDefaults (
4+ defineProps <{ test: Test }>(),
5+ { test: () => [] },
6+ )
7+ </script >
You can’t perform that action at this time.
0 commit comments