File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
packages/compiler-sfc/__tests__/compileScript Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -731,6 +731,22 @@ describe('resolveType', () => {
731731 } )
732732 } )
733733
734+ test ( 'TSMappedType with indexed access' , ( ) => {
735+ const { props } = resolve (
736+ `
737+ type Prettify<T> = { [K in keyof T]: T[K] } & {}
738+ type Side = 'top' | 'right' | 'bottom' | 'left'
739+ type AlignedPlacement = \`\${Side}-\${Alignment}\`
740+ type Alignment = 'start' | 'end'
741+ type Placement = Prettify<Side | AlignedPlacement>
742+ defineProps<{placement?: Placement}>()
743+ ` ,
744+ )
745+ expect ( props ) . toStrictEqual ( {
746+ placement : [ 'String' , 'Object' ] ,
747+ } )
748+ } )
749+
734750 describe ( 'type alias declaration' , ( ) => {
735751 // #13240
736752 test ( 'function type' , ( ) => {
You can’t perform that action at this time.
0 commit comments