We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.4.25
https://play.vuejs.org/#eNqFUttu00AQ/ZVhVclFCrGgPAU3Eo2KgEpQQVQeWKQae2K23Zt21yHF+N87u07Sptcn+8yZnTkzczr23trxskU2YYWvnLABPIbWTrkWyhoXYGaUhYUzCrJxHkFMz95t+Q4cLqBfp0SOa64ro30A5Rs4jPx+9hGlNPDDOFm/yF5yXeRDO2pEIKCysgxICKBILSeVkf6VbA45e83ZGqqa4Jst9IrgAcGcHhb5rSpsxIInEQvRjC+80TRfF2tzVlFxIdF9tUGQSM4mkJjIlaTx7+cUC67F0SZe/cHq8oH4hV/FGGenDj26JXK25ULpGgwDffz9C67of0sqU7eSsp8gv6E3so0ah7SjVtck+1ZeUvspXUHoZu6PVwG13wwVhcbMPuVzRpeJe31s9Bu5B+O36R3XPW1xc/G7BgFZ6nibQGVo3+HKIhw5LC+tETp4OnvmVQb/IVN1+sgmGeNO4oeyCsZdFXOgHaCuPfjgaJoRnE2pRpL38wSE3ileejjf6+b9XjcrrQilFP+wOJn2578mcEbTaBK/bjUjn+zqut88i2bKRqBb9RtdcuTgX+uMjU9qXAiNpxGROXcKTvefMXMtlukHoOvWBXuSR0w+ULu+7a8ByEs06A==
Create a mapped type like so:
type Breakpoints = 'sm' | 'md' | 'lg' type BreakpointFactory<T extends string, V> = { [K in Breakpoints as `${T}${Capitalize<K>}`]: V } type ColsBreakpoints = BreakpointFactory<'cols', number> const props = defineProps<ColsBreakpoints>()
Props receive the correct props definition during the runtime
The TS actually knows what the type is, if you observe the App.vue in the reproduction, it knows of cols-lg cols-md cols-sm existence
cols-lg cols-md cols-sm
However, the runtime isn't able to generate the correct types. It believes the required types to be 'lg' |'md' | 'sm'
System: OS: Linux 6.8 Pop!_OS 22.04 LTS CPU: (16) x64 AMD Ryzen 7 7800X3D 8-Core Processor Memory: 17.64 GB / 30.50 GB Container: Yes Shell: 5.1.16 - /bin/bash Binaries: Node: 20.7.0 - /run/user/1000/fnm_multishells/51021_1715892856327/bin/node npm: 10.1.0 - /run/user/1000/fnm_multishells/51021_1715892856327/bin/npm pnpm: 8.6.5 - ~/.local/share/pnpm/pnpm bun: 1.0.2 - ~/.bun/bin/bun
No response
The text was updated successfully, but these errors were encountered:
fix(compiler-sfc): support as keyword with template literal types (#1…
2594b1d
…1100) close #10962
Successfully merging a pull request may close this issue.
Vue version
3.4.25
Link to minimal reproduction
https://play.vuejs.org/#eNqFUttu00AQ/ZVhVclFCrGgPAU3Eo2KgEpQQVQeWKQae2K23Zt21yHF+N87u07Sptcn+8yZnTkzczr23trxskU2YYWvnLABPIbWTrkWyhoXYGaUhYUzCrJxHkFMz95t+Q4cLqBfp0SOa64ro30A5Rs4jPx+9hGlNPDDOFm/yF5yXeRDO2pEIKCysgxICKBILSeVkf6VbA45e83ZGqqa4Jst9IrgAcGcHhb5rSpsxIInEQvRjC+80TRfF2tzVlFxIdF9tUGQSM4mkJjIlaTx7+cUC67F0SZe/cHq8oH4hV/FGGenDj26JXK25ULpGgwDffz9C67of0sqU7eSsp8gv6E3so0ah7SjVtck+1ZeUvspXUHoZu6PVwG13wwVhcbMPuVzRpeJe31s9Bu5B+O36R3XPW1xc/G7BgFZ6nibQGVo3+HKIhw5LC+tETp4OnvmVQb/IVN1+sgmGeNO4oeyCsZdFXOgHaCuPfjgaJoRnE2pRpL38wSE3ileejjf6+b9XjcrrQilFP+wOJn2578mcEbTaBK/bjUjn+zqut88i2bKRqBb9RtdcuTgX+uMjU9qXAiNpxGROXcKTvefMXMtlukHoOvWBXuSR0w+ULu+7a8ByEs06A==
Steps to reproduce
Create a mapped type like so:
What is expected?
Props receive the correct props definition during the runtime
What is actually happening?
The TS actually knows what the type is, if you observe the App.vue in the reproduction, it knows of
cols-lg cols-md cols-sm
existenceHowever, the runtime isn't able to generate the correct types. It believes the required types to be 'lg' |'md' | 'sm'
System Info
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: