🌺 作者主页: 🌱仙女不下凡🌱

🌺 欢迎点赞 👍 收藏 ⭐留言 📝 如有错误敬请指正!


提示:[Vue warn]: children must be keyed:

<el-col :span="6" v-if="SearchView(routerName.ifSecondaryChannel)">
          <el-form-item label="二级渠道:">
            <el-select
              v-model="twochannelnameIds"
              multiple
              clearable
              placeholder="请选择二级渠道"
              @change="getTwochannelDataListAfterQuery"
            >
              <el-option
                v-for="item in SecondChannelsOptions" //初试数据已经获取
                :key="item.id"
                :label="item.channelname"
                :value="item"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>

这个问题是个小细节不容易被注意到,解决办法加上value-key属性,原因是作为 value 唯一标识的键名,绑定值 (即:value=“item”)为对象类型时必填.

<el-col :span="6" v-if="SearchView(routerName.ifSecondaryChannel)">
          <el-form-item label="二级渠道:">
            <el-select
              v-model="twochannelnameIds"
              multiple
              clearable
              placeholder="请选择二级渠道"
              value-key="id"
              @change="getTwochannelDataListAfterQuery"
            >
              <el-option
                v-for="item in SecondChannelsOptions"
                :key="item.id"
                :label="item.channelname"
                :value="item"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>

解决.

Logo

前往低代码交流专区

更多推荐