I
I
it_pear_yurec2021-04-15 12:54:30
Vue.js
it_pear_yurec, 2021-04-15 12:54:30

How to get the value of the label field?

There is a select (the elemnt ui library is taken) it has a value value, it is selected and written to the controls.category variable, written to the item.slug value, item.slug is the value in English, but there is also the item.label value - it is in Russian , that's the question, how to take and write the value of the selected item.label to some variable ??? this is necessary in order to take the value from the database in the future, select the category of the post, of course, you need to display the category in Russian and not in English)

<el-select v-model="controls.category" placeholder="Выберите категорию">
          <el-option
            v-for="item in categories"
            :key="item.category"
            :label="item.title"
            :value="item.slug"
          >
          </el-option>
        </el-select>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tantumus21, 2021-04-15
@it_pear_yurec

peek here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question