- Create a
<script setup lang="ts">
Setup.vue component - Define the props via an
interface
interface Props {
msg: string;
}
defineProp<Props>();
- Create a
<script lang="ts">
Define component that uses Setup.vue npm run type-check
npm i
npm run type-check
You'll see
src/components/Define.vue:20:1 - error TS4082: Default export of the module has or is using private name 'Props'.
20 export default defineComponent({
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21 components: {
~~~~~~~~~~~~~~~
...
23 },
~~~~
24 });
~~~
Found 1 error.