components/tip/index.js
/**
     * Get the relative position of an element
     * inside a wrapper
     */
Get the relative position of an element
inside a wrapper
Get the relative position of an element inside a wrapper
$_getPosition(node, wrapper) {
      let x = 0
      let y = 0
      let el = node
      while (el) {
        x += el.offsetLeft
        y += el.offsetTop
        if (el === wrapper || el === document.body || el === null) {
          break
        }
        el = el.offsetParent
      }
      return {x, y}
    }
$_getPosition ( node , wrapper ) { let x = 0 let y = 0 let el = node while ( el ) { x += el . offsetLeft y += el . offsetTop if ( el === wrapper || el === document . body || el === null ) { break } el = el . offsetParent } return { x , y } }
Get the relative position of an element
 inside a wrapper
Get the relative position of an element inside a wrapper