修复单个页面中有多个表格可拖拽

This commit is contained in:
zyn
2023-02-06 15:29:34 +08:00
parent b2f9f287ba
commit 44f329867e
+11
View File
@@ -5,6 +5,7 @@ const events = {
move: 'mousemove',
stop: 'mouseup'
}
let tableAll = []
var columnsAll = []
var columnsKey = ''
const DragHandler = {
@@ -88,6 +89,9 @@ const DragHandler = {
const ResizeHeaderOne = function(val, name) {
columnsAll = val
columnsKey = name
if(tableAll.indexOf(val) === -1){
tableAll.push(val)
}
return (h, props, children) => {
const { key, column, ...restProps } = props
let col = {}
@@ -192,6 +196,13 @@ export const ResizeColumnProvide = {
},
methods: {
_resizeColumn(w, column) {
tableAll.forEach(item=>{
item.forEach((i)=>{
if(i.dataIndex === column.dataIndex){
columnsAll = item
}
})
})
this.moving = true
let time = setTimeout(() => {
this.moving = false