Error in mounted hook: “Error: please transfer a valid prop

created at 09-13-2021 views: 1

I encountered such an error when writing the form_item loop today and recorded it.

Then we need to use the form loop,
I wrote it directly in the form_item at the beginning, but when I reset the form, I found that it could not be reset. Then I added a layer of form-item to the el-input. I also checked the related errors on the Internet and found that they were all: prop=" 'item.'+index+'.index2'" and so on, but it didn't solve my problem. The error still persists, and the form cannot be reset at the same time.

Consider slowly at this time. In fact, it is an array loop. Then we will get the accurate value to eliminate this error.

<el-form-item
        v-for="(order_award, index) in form.award_config.order_award
          .order_award_list"
        label-width="10"
        style="margin-bottom: 0"
        prop="order_award"
        :key="index"
      >
        <div>
          <el-row :gutter="12" type="flex">
            <el-col :span="4" v-if="!(form.award_config.award_type == 1)">
              <el-form-item label-width="0" :prop="'award_config.order_award.order_award_list['+index+'].order_count'">
                <el-card shadow="never" class="reward_content_card">
                <span
                  class="input_unit"
                  style="margin-right: 5px; font-size: 14px"
                  >完单</span
                ><br />
                <span class="input_unit"></span>
                <el-input
                  class="reward_content_padding reward_content_input"
                  v-model="order_award.order_count"
                >
                </el-input>
                <div class="input_unit"></div>
              </el-card>
              </el-form-item>
            </el-col>
          </el-row>
       </el-form-item>

Mainly this piece of code

:prop="'award_config.order_award.order_award_list['+index+'].order_count'"

Get to the detailed location to solve the error.

Please log in to leave a comment.