添加循环项,滑动条到最下方
  ltsplqN9LP9z 2023年11月13日 20 0
filterScrollTo() {
      const parent = document.querySelector('#quoteitemcon');
      const child = document.getElementsByClassName('quote-con');
      console.log('parent', parent, child);
      parent.scrollTo({
        top: child[child.length - 1].offsetTop,
        behavior: 'smooth'
      });
    },

 // 删除条件
    deleteQuote(index, fieldIndex) {
      this.tableColumns[index].fieldInfo.quoteRelationship.splice(
        fieldIndex,
        1
      );
      console.log(
        'index',
        index,
        fieldIndex,
        this.tableColumns[index].fieldInfo.quoteRelationship
      );
      // this.filterData.splice(index, 1);
      this.$nextTick(() => {
        this.filterScrollTo();
      });
    },
// 添加同理,也需要调
 this.$nextTick(() => {
        this.filterScrollTo();
      });

切记:同一个页面多个地方使用或者多个页面使用filterScrollTo,记得把父子组件的id名称换掉

<el-col :span="24" class="quote-item-con" id="quoteitemcon">
                    <label
                      style="margin-bottom: 10px; display: block"
                      v-show="fieldOption.length > 0"
                      >引用条件</label
                    >
                    <div
                      v-for="(quoteItem, fieldIndex) in column.fieldInfo
                        .quoteRelationship"
                      :key="fieldIndex"
                      class="quote-con"
                    >
                      <i
                        class="el-icon-close"
                        @click="deleteQuote(index, fieldIndex)"
                      ></i>
                      <el-form-item
                        label=""
                        prop="relationshipFiledName"
                        style="padding: 0 5px; margin-bottom: 0"
                        class="rule-small-item"
                      >
                        <el-select v-model="quoteItem.relationshipFiledName">
                          <el-option
                            v-for="item in fieldOption"
                            :key="item.id"
                            :label="item.fieldRemarks"
                            :value="item.fieldName"
                          ></el-option>
                        </el-select>
                      </el-form-item>
</div>
</el-col>



【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月13日 0

暂无评论

推荐阅读
ltsplqN9LP9z