\r\n\r\n```\r\n\r\nThis error come since vue-tsc 1.7.12","author":{"url":"https://hamdit.com/proxy/.com/xiaoxiangmoe","@type":"Person","name":"xiaoxiangmoe"},"datePublished":"2023-10-17T05:42:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://hamdit.com/proxy/schema.org/CommentAction","userInteractionCount":6},"url":"https://hamdit.com/proxy/.com/13104/vue/issues/13104"}
Open
vuejs/language-tools
#3674
@xiaoxiangmoe

Description

https://.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