html代码

     <el-select
            v-model="districtName"
            @change="getStreetList(districtName)"
            placeholder="请选择"
            style="margin-bottom: 20px"    
          >
          <el-option
            v-for="item in districts"
            :key="item.id"
            :label="item.districtName"
            :value="item.id"
            id=selectColor
          >
          </el-option>
     </el-select>

js代码

selectColor() {
          for (var i = 0; i < selectColor.length; i++) {
            selectColor[i].style.color="red"
          }  
      }
Logo

前往低代码交流专区

更多推荐