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.2.37
https://stackblitz.com/edit/vitejs-vite-zgu6sg?file=src%2FPosition.vue
// Position.ts export enum Position { First = 'FIRST', Second = 'SECOND', Third = 'THIRD', }
<!-- Child.vue --> <script setup lang="ts"> import { Position } from './Position.ts'; type FirstAndSecond = Exclude<PositionList, PositionList.Third>; // PositionList.First | PositionList.Second defineProps<{ position: FirstAndSecond; }>(); </script>
<!-- Parent.vue --> <script setup lang="ts"> import { Position } from './Position.ts'; </script> <template> <Child :position="Position.First" /> <!-- [Vue warn]: Invalid prop: type check failed for prop "position". Expected Object, got String with value "FIRST". --> </template>
No warning error
[Vue warn]: Invalid prop: type check failed for prop "position". Expected Object, got String with value "FIRST".
System: OS: Windows 10 10.0.19041 CPU: (16) x64 AMD Ryzen 7 3700X 8-Core Processor Memory: 5.62 GB / 31.95 GB Binaries: Node: 16.13.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.19 - ~\.yarn\bin\yarn.CMD npm: 8.1.3 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: Spartan (44.19041.423.0) Internet Explorer: 11.0.19041.1 npmPackages: vue: ^3.2.37 => 3.2.37
This works perfectly when there is no exclusion and the enum is used directly.
The text was updated successfully, but these errors were encountered:
fix(better-define): infer TS Extract&Exclude runtime type
8d919f8
discussion #285 vuejs/core#7339 vuejs/core#7337 vuejs/core#6252
fix(compiler-sfc): infer TS Extract&Exclude runtime type (#7339)
6391daf
closes #7337 closes #6252
fix(compiler-sfc): infer TS Extract&Exclude runtime type (vuejs#7339)
e238ff5
closes vuejs#7337 closes vuejs#6252
Successfully merging a pull request may close this issue.
Vue version
3.2.37
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-zgu6sg?file=src%2FPosition.vue
Steps to reproduce
What is expected?
No warning error
What is actually happening?
[Vue warn]: Invalid prop: type check failed for prop "position". Expected Object, got String with value "FIRST".
System Info
Any additional comments?
This works perfectly when there is no exclusion and the enum is used directly.
The text was updated successfully, but these errors were encountered: