[Vuejs]-How can I formatt a value in v-for inside a el-option in element ui

0๐Ÿ‘

โœ…

You can directly use the function.

<el-option
      v-for="item in orcindex"
      :key="item.id"
      :label="item.name + ' - ' + cellValueRenderer(item.value) + '%'"
      :value="item.id"
    />

0๐Ÿ‘

You should use slots to have a custom label

<el-form-item :label="label" :required="required" prop="Jan">
      <el-select v-model="Jan" clearable filterable placeholder="Selecione" :multiple="multiple" :disabled="disabled" :loading="loading" @change="onChange">
        <el-option
          v-for="item in orcindex"
          :key="item.id"
          :value="item.id"
        >
        <span>{{ cellValueRenderer(item.label) }}</span>
        </el-option>
      </el-select>
    </el-form-item>

Leave a comment