T
T
Tenebrius2018-09-26 14:28:12
Vue.js
Tenebrius, 2018-09-26 14:28:12

How to organize two-way binding in an input nested in a component?

Good afternoon.
I'm trying to make a wrapper over a standard input, the problem is that data is transferred inside, but does not go outside.
Examples: https://jsfiddle.net/Tenebrius/c7r8h5gf/28/
In the first example everything works fine.
In the second, the data changes internally, but does not go outward to the main model.
And the third example is relevant, I want to organize something like this.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-09-26
@Tenebrius

It is necessary to forward the input event, i.e. replace with

<range :value="value" @input="$emit('input', $event)"></range>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question