Hello,
I am using NumericTextBox and DropdownList Component in Vue3.
It works fine but I keep seeing warning in the browser console window.
[Vue warn]: Component emitted event "update:modelValue" but it is neither declared in the emits option nor as an "onUpdate:modelValue" prop.
I don't know how can i fix it. I need help.
thanks
This is part of my source code.
1. first tried
< Parent>
<input-prop:inputValue='subItem.value' :itemKey="subItem.key"@changeVal='onInputValChange' :enabled='subItem.enabled'></input-prop>
< Child >
<template><div class="input-prop-box"><div class="input-prop-desc" :title='description'>{{ description }}</div><div class="input-prop-value"><ejs-numerictextbox :placeholder="emptyValue" :value='inputValue'@change='onChange' :enabled="enabled"></ejs-numerictextbox></div></div></template><script>import { NumericTextBoxComponent } from "@syncfusion/ej2-vue-inputs";export default {name: 'NumDataComponent',components: {'ejs-numerictextbox': NumericTextBoxComponent},props: {description: {required: true, type: String},inputValue: {type: Number},itemKey: {type: String},enabled: {type: Boolean, default: true}},data: () => {return {emptyValue: "-"}},methods:{onChange: function(e){this.$emit('changeVal', this.itemKey, e.value)}}}</script>
2. second tried, (changed)
< Parent>
<input-prop:modelValue='subItem.value' :itemKey="subItem.key"@changeVal='onInputValChange' :enabled='subItem.enabled'></input-prop>
< Child >
<template><div><ejs-numerictextbox :placeholder="emptyValue" v-model="inputValue" :enabled="enabled"></ejs-numerictextbox></div></template><script>import { NumericTextBoxComponent } from "@syncfusion/ej2-vue-inputs";export default {name: 'NumDataComponent',components: {'ejs-numerictextbox': NumericTextBoxComponent},props: {modelValue: {type: Number},itemKey: {type: String},enabled: {type: Boolean, default: true}},emits: ['update:modelValue', 'changeVal'],data: () => {return {emptyValue: "-"}},computed:{inputValue: {get(){return this.modelValue},set(val){this.onChange(val)}}},methods:{onChange: function(e){this.$emit('changeVal', e)}}}</script>
Hi kim,
We suggest you refer to the below public blogs for the reported query,
If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.
Kindly try the above suggestion and let us know if this meets your requirement. If we misunderstood the requirement, we request you to provide additional details about the requirement as mentioned below. This will help us validate the requirement further and provide you with a better solution.
Udhaya Kumar D
Hi,
Number 4 is similar to my request.
I have tested another case.
One of example code in syncfusion.
https://ej2.syncfusion.com/vue/documentation/numerictextbox/two-way-binding/
It also shows a warning message
[Vue warn]: Component emitted event "update:modelValue" but it is neither declared in the emits option nor as an "onUpdate:modelValue" prop.
I think this is an internal problem with component in vue3. (DropdownList Component has the same problem)
Thanks.
Hi Kim,
We are validating your reported query. We will update you with further details on or before Sep 26, 2022.
Regards,
Buvana S`
Hi Kim,
Sorry for the inconvenience caused.
Due to complexity, We are still validating the requirement. We will update the further details in two business days (28th September 2022).
Regards,
Udhaya Kumar D
Hi Kim,
Sorry for the inconvenience caused.
We have prepared a sample based on the shared code snippet and validated on our end. Unfortunately, we couldn’t reproduce the reported issue as per your scenario. We also shared a sample for reference. Also, we request you to provide additional details about the issue as mentioned below, This will help us validate the issue further and provide you with a better solution.
1. Issue reproducing sample (or modify the shared sample as per your scenario).
2. Issue replication steps.
3. Video illustration of the issue.
Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/vue3sample-184869770
Udhaya Kumar D