Component v-model throw warning "Component emitted event "update:modelValue" but it is neither declared in the emits option nor as an "onUpdate:modelValue" prop." when using with interface
Vue version
3.3.4
Link to minimal reproduction
Steps to reproduce
Initial:
- Make interface Foo:
interface Foo { (e: 'update:modelValue', value?: boolean | string | object | number): void }
Using with extends interface:
- create interface Bar extends Foo
- pass interface Foo to defineEmits
interface Bar extends Foo { (e: 'bar'): void }
==>throw warning when updating modelValue
Using with type intersection:
- create
type Bars = Foo & { (e: 'bar'): void }
==> work normal
What is expected?
update modelValue working without warning
What is actually happening?
update modelValue throw warning: Component emitted event "update:modelValue" but it is neither declared in the emits option nor as an "onUpdate:modelValue" prop.
System Info
No response
Any additional comments?
No response
https://github.com/vuejs/core/issues/8465 duplicate question cc @edison1105