Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
526 views
in Technique[技术] by (71.8m points)

elementUI拖拽后排序箭头问题

问题描述

elementUI拖拽后排序箭头蓝色颜色变为灰色

问题出现的环境背景及自己尝试过哪些方法

把key换成index但是显示和隐藏的时候会出现布局错位

相关代码

  <el-table-column :key="Math.random()" :sort-orders="['descending','ascending']"
                         v-if="item.bool" sortable="custom"
                         v-for="(item,index) in col" :prop="item.prop" :label="item.label">
        </el-table-column>
col: [
                {
                    label: '日期',
                    prop: 'date',
                    bool: true,
                },
                {
                    label: '姓名',
                    prop: 'name',
                    bool: true,
                },
                {
                    label: '地址',
                    prop: 'addRes', 
                    bool: true,
                },

            ],
   columnDrop() {
                const wrapperTr = document.querySelector('.el-table__header-wrapper tr');
                this.sortable = Sortable.create(wrapperTr, {
                    animation: 180,
                    delay: 0,
                    onEnd: evt => {
                        const oldItem = this.col[evt.oldIndex];
                        this.col.splice(evt.oldIndex, 1);
                        this.col.splice(evt.newIndex, 0, oldItem);
                    }
                })
            },

你期待的结果是什么?实际看到的错误信息又是什么?

QQ图片20200805094902.pngQQ图片20200805094910.png

求各位大佬帮忙看下,感谢


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...