<template>
  <div ref="root">
    <slot></slot>
  </div>
</template>
<script>
import GeminiScrollbar from 'gemini-scrollbar';
import 'gemini-scrollbar/gemini-scrollbar.css';

let scrollbarInstance;

export default {
  name: 'scroll-container',
  mounted(){
    scrollbarInstance = new GeminiScrollbar({
      element: this.$refs.root
    }).create();
  },
  updated(){
    scrollbarInstance.update();
  }
}
</script>