// 滚动到指定位置
function getAnchor(_ref) {
  var _currentButtonDOM$cla, _currentButtonDOM$cla2;
  var x = _ref.x,
    y = _ref.y;
  var currentButtonDOM = document.elementFromPoint(x, y);
  if (!(currentButtonDOM !== null && currentButtonDOM !== void 0 && (_currentButtonDOM$cla = currentButtonDOM.classList) !== null && _currentButtonDOM$cla !== void 0 && (_currentButtonDOM$cla2 = _currentButtonDOM$cla.contains) !== null && _currentButtonDOM$cla2 !== void 0 && _currentButtonDOM$cla2.call(_currentButtonDOM$cla, 'indexbar-button'))) return '';

  // 获取当前选中项
  var anchor = currentButtonDOM.getAttribute('data-indexbar-anchor-button');
  if (!anchor) return '';
  return anchor;
}
export default getAnchor;