C
C
Cyril2020-09-16 12:32:27
Vue.js
Cyril, 2020-09-16 12:32:27

How does vue compare inputs with v-model inside it?

Actually the question is in the title.
I'm wondering how such a check is done with v-model. Let's say we have a Select with a large array of deep objects?
I just do my custom select, and when changing value, I iterate over the incoming array of objects with a deep check of the object of the current iteration and what is in value in order to display which object is selected in the placehoolder Select.
Does it make sense to make a regular Select inside my Select and do a v-model with it, so that vue itself does the comparison of objects, strings, etc.?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2020-09-16
@rpsv

What does deep object mean? The tree-like hierarchy means or what? If yes, then look
towards https://vue-treeselect.js.org
In any case, each object must have an identifier, and then the select will not store the entire object, but only its identifier.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question