在项目中 做矩阵题  嵌套的v-for 

<!-- 多选矩阵题 -->
          <template v-if="question.name==='MATRIX_CHECKBOX'">
            <div class="matrix-preview-line" v-for="(item,index) in question.opts" :key="index">
              <el-checkbox-group @change="initCheckboxAnswer" v-model="item.answer" v-if="question.name==='MATRIX_CHECKBOX'" style="display: flex;width: 100%;">
                <span class="cols cols-first editinput">
                  {{item.title}}
                </span>
                <span class="cols" v-for="(opt,index) in question.cols" :key="index">
                  <el-checkbox :label="opt.id">{{ }}</el-checkbox>
                </span>
              </el-checkbox-group>
            </div>
          </template>

  在作答的时候 选中答案 答案不能及时的更新到视图当中,在change 事件中调 this.$forceUpdate()  让视图强制刷新

相关文章:

  • 2021-06-19
  • 2022-12-23
  • 2021-04-18
  • 2022-12-23
  • 2021-09-13
  • 2022-12-23
  • 2021-04-28
  • 2021-04-24
猜你喜欢
  • 2021-08-02
  • 2021-04-03
  • 2022-12-23
  • 2021-06-08
  • 2021-08-15
  • 2022-01-24
  • 2021-11-02
相关资源
相似解决方案