File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
packages/runtime-core/src Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ export function defineProps<
7676 PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions
7777> ( props : PP ) : Prettify < Readonly < ExtractPropTypes < PP > > >
7878// overload 3: typed-based declaration
79- export function defineProps < TypeProps > ( ) : ResolveProps < TypeProps >
79+ export function defineProps < TypeProps > ( ) : DefineProps < TypeProps >
8080// implementation
8181export function defineProps ( ) {
8282 if ( __DEV__ ) {
@@ -85,13 +85,9 @@ export function defineProps() {
8585 return null as any
8686}
8787
88- type ResolveProps < T , BooleanKeys extends keyof T = BooleanKey < T > > = Prettify <
89- Readonly <
90- T & {
91- [ K in BooleanKeys ] -?: boolean
92- }
93- >
94- >
88+ type DefineProps < T > = Readonly < T > & {
89+ readonly [ K in BooleanKey < T > ] -?: boolean
90+ }
9591
9692type BooleanKey < T , K extends keyof T = keyof T > = K extends any
9793 ? [ T [ K ] ] extends [ boolean | undefined ]
@@ -373,3 +369,11 @@ export function withAsyncContext(getAwaitable: () => any) {
373369 }
374370 return [ awaitable , ( ) => setCurrentInstance ( ctx ) ]
375371}
372+
373+ ; < T extends string > ( ) => {
374+ interface Props {
375+ foo : T
376+ }
377+ const props = defineProps < Props > ( )
378+ props . foo
379+ }
You can’t perform that action at this time.
0 commit comments