#StackBounty: #vue.js #vuejs2 #element-ui Initial label with 'el-select' is not applied

Bounty: 50

I have the following code using el-select from Element UI framework for Vue.js:

<el-select v-model="selectTagPicker" @change="handleTagChange(selectTagPicker)">
     <el-option v-for="(tag, tagIndex) in allTags" :key="tag.id" :value="tagIndex" :label="tag.name">
          {{ tag.name }}
     </el-option>
</el-select>

The problem here is that on the first load, the label is not applied, but it shows the value instead (which in my case is just an array index), and the user is always greeted with "0", instead of the tag name (since I always load the first item in the array, and I need to show that as well).

Every subsequent selection of the option from the dropdown is done properly for both values and labels.

How can I make sure to apply a proper label (which should be a tag name), on the first load as well?


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.