You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
#8643
Closed
minhtien020900 opened this issue
Jun 26, 2023
· 1 comment
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
The text was updated successfully, but these errors were encountered:
minhtien020900
changed the title
Component v-model throw warning when using with interface
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
Jun 26, 2023
Vue version
3.3.4
Link to minimal reproduction
https://play.vuejs.org/#eNqNVMFy0zAQ/ZVFB5zOhOTAzThmaKcMcIAOMHDRxbE3iVpZ8khy0o7xv7Mr13ETKEMukXbf7r7dfVYn3jXNYt+iSEXmS6eaAB5D2+TSqLqxLkAHDjfQw8bZGhKCJkfX1U7p6srSxaAJj4jF8tTM2ZM30khTWuMD1H4LK845Sz6g1hZ+WqerF8mFNNlyoEDF6RKwbnQRkG4AXUdxfc/H7Kzs/lVtK9QrKQgiRZ6dEaD4bHlMJuYieGKyUdvFrbeGGu84qxQlBSiN7ksTFDGVIoXoYV9BRA+foi24FuejvdxhefcX+62/Z5sUNw49uj1KcfSFwm0xDO7rb5/xns5HJ7XSakL/w/kVvdUtcxxgl62piPYTXGT7Me5Ime13f30f0PixKSbKyD7ipaD98Kyea32i+3rxOsZJ09MU/9zyuYZAF2ZLawmUMJfuVFFzHncbsDqVFqEi0gR0m6JEeG8tBcAMU0japqIVpnHdPwpN+Dns+f9tCmtrNRYGfoEPjrqmg13fYhnoYNp6je4ihb1VVI8LDFpsnG08qbHCjTJ4w7esm9KnhXno89nFyGq5hNUqh7Bz9gCHwhHNLSgDnIyqg9pA6wfbSP+ycEBLRFN5buW0tzMn9RnbXBcuOSF7Vv9g3R0Y6+pCTyXDQ0MEOLWnpmmLcFBhxyU8h0Y3X6hbLvXyf4oNQ8JahWlI13zLOBMNJtJpaZh1zV9isBDQh2m+z4Ry5FhmAMYtEnAURUaTz2cdA1iFJMAUuFxOuny08c+RzJwZ1riY9jZCSOGPJ9IjJaAqY6vnmSLT2XMKiwqIGUfa/VEU06M1GqaHK0ZlylBPT56p2KwUEP1Pn6b+N65m54g=
Steps to reproduce
Initial:
interface Foo { (e: 'update:modelValue', value?: boolean | string | object | number): void }
Using with extends interface:
interface Bar extends Foo { (e: 'bar'): void }
==>throw warning when updating modelValue
Using with type intersection:
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
The text was updated successfully, but these errors were encountered: