E
E
ettaluni2021-11-11 16:14:04
Vue.js
ettaluni, 2021-11-11 16:14:04

El-select why concatenate data?

Good day! I'm trying to add a simple element to a drop down list. And for some reason he does not display them normally. More precisely, it displays them, but they are hidden, and in the preview of the select they are combined.

// Вот данные
divisions: ['asdas', '234234', 'cvbcv'],

// Вот вызов
<el-form-item label="Divisions" prop="division">
                        <el-select v-model="this.divisions" class="w-100 no-hover-bg">
                            <el-option v-for="(dvs, key) in divisions" :key="key" :value="dvs" :label="dvs"/>
                        </el-select>
                    </el-form-item>


Here is how it is displayed:
618d1696c1d18165391366.png
At the same time, they are in the layout. But vue hides them.
618d16f38524b496425491.png
I did not put some trifle, can someone tell me what's wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2021-11-11
@0xD34F Vue.js

<el-select v-model="this.divisions"

<el-option v-for="(dvs, key) in divisions"

That is, the same property is used both to create options and to control the value. Clever.
"Combines data" because the value of the select is a string, you specified an array as a value, the array cast to the string is its elements glued together, separated by commas.
618d16f38524b496425491.png

It looks like the component el-optionis not registered.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question