-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
not working with custom inputs #6
Comments
I am pretty sure I was getting "Cannot read property 'value' of undefined" on a custom component that emitted a new value with the |
If you'll ever meet this problem again can you please copy the code too?
…On 25 Aug. 2017 10:53 am, "Carlos Gonzales" ***@***.***> wrote:
I am pretty sure I was getting "Cannot read property 'value' of undefined"
on a custom component that emitted a new value with the input event, so I
assumed this was the issue.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABjuIqRp9hkfSX61qPFiOK_teThFJ9HHks5sbf8DgaJpZM4O7ES8>
.
|
Ok, I tested right now and am not getting the error anymore (something probably changed after I updated your module), but the value isn't being changed either. This does not change the value: <filter-input v-model={this.filtro}/> This does: <filter-input value={this.filtro} onInput={value => this.filtro = value}/> In your example I see: onChange={$$v => {
_this.b = $$v;
}} Maybe that's it? Shouldn't the default there be to use |
@rhyek, yep, you are right, will fix it now |
@nickmessing, I just tested 2.0.2 and I'm sorry to say it's still not updating the value. Is there anything I can do to help you debug this? |
@rhyek, it can be that it compiles to |
Can you please check if this one works with your custom input? <something-else
value={this.b}
onInput={$$v => {
this.b = $$v;
}}
{...{
directives: [{
name: "model",
value: this.b
}]
}} /> |
This works: <filter-input
value={this.filtro}
onInput={$$v => this.filtro = $$v}
{...{
directives: [{
name: 'model',
value: this.filtro
}]
}}
/> But so does this: <filter-input
value={this.filtro}
onInput={$$v => this.filtro = $$v}
/> |
@rhyek, well |
2.0.3 Still not working. Do you have a way to test this yourself? It might be that I'm doing something I'm not supposed to. |
@rhyek, can you share code of your custom component? |
|
Reformatted. |
For what it's worth, this doesn't work with the Bootstrap-Vue custom checkboxes:
This does:
Here's their component: It doesn't appear to actually bind to the value. |
The plugin is expecting there to always be a DOM event object passed to the event callback. With custom inputs, the parameter given is the actual new value.
See https://vuejs.org/v2/guide/components.html#Form-Input-Components-using-Custom-Events.
The text was updated successfully, but these errors were encountered: