defineProps does not support a type that uses Omit
Vue version
^3.2.33 => 3.2.36
Link to minimal reproduction
Steps to reproduce
- Create an interface
- Update the interface with Omit
- Pass the Omitted type to defineProps
What is expected?
It would pick up the omitted type inside the defineProps.
What is actually happening?
A compiler error stating:
[@vue/compiler-sfc] type argument passed to defineProps() must be a literal type, or a reference to an interface or literal type```
### System Info
```shell
System:
OS: macOS 12.4
CPU: (10) arm64 Apple M1 Max
Memory: 130.52 MB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 17.9.0 - ~/.nvm/versions/node/v17.9.0/bin/node
Yarn: 1.22.17 - /opt/homebrew/bin/yarn
npm: 8.11.0
Browsers:
Chrome: 102.0.5005.115
Firefox: 101.0.1
Safari: 15.5
npmPackages:
vue: ^3.2.33 => 3.2.36
Any additional comments?
No response
I'd say thats another aspect of the currently documented restrictions:
As of now, the type declaration argument must be one of the following to ensure correct static analysis:
- A type literal
- A reference to an interface or a type literal in the same file
https://vuejs.org/api/sfc-script-setup.html#typescript-only-features
Insofar it's not a bug.