export const elScrollToBottom = (parentSelector: string) => {
  nextTick(() => {
    const container = _getScrollBox(parentSelector)
    if (container) {
      container.scrollTop = container.scrollHeight
    }
  })
}

export const elScrollToTop = (parentSelector: string) => {
  nextTick(() => {
    const container = _getScrollBox(parentSelector)
    if (container) {
      container.scrollTop = 0
    }
  })
}

const _getScrollBox = (selector: string) => {
  return document.querySelector(`${selector} .el-scrollbar__wrap`)
}
