This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vue.directive('drag', (el) => { | |
const oDiv = el // 当前元素 | |
const minTop = oDiv.getAttribute('drag-min-top') | |
const ifMoveSizeArea = 20 | |
oDiv.onmousedown = e => { | |
let target = oDiv | |
while (window.getComputedStyle(target).position !== 'absolute' && target !== document.body) { | |
target = target.parentElement | |
} |