Description
https://github.com/xiaoxiangmoe/issue-vue-2.7-on-click-type-error.git
pnpm run type-check
src/App.vue:12:6 - error TS2559: Type '{ onClick: any; }' has no properties in common with type 'Readonly<Partial<{}> & Omit<Readonly<ExtractPropTypes<{ border: { type: PropType<boolean>; }; }>>, never>>'.
12 <HelloWorld @click="handleClick" />
~~~~~~~~~~
Found 1 error in src/App.vue:12
HelloWorld.vue
<script setup lang="ts">
interface ButtonProps {
border?: boolean;
}
const props = defineProps<ButtonProps>()
defineEmits<{
(event: 'click',payload: MouseEvent): void
}>()
</script>
<template>
<div id="app">
<button @click="$emit('click', $event)">Click me</button>
</div>
</template>
This error come since vue-tsc 1.7.12
Activity