ff-scrollbar.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <div class="outer" :class="{'isEn': language !== 'zh'}">
  3. <slot name="con"></slot>
  4. <div class="ff-scrollbar">
  5. <div ref="thumb" class="ff-scroll-thumb" :style="{top:scorlltop}"></div>
  6. </div>
  7. </div>
  8. </template>
  9. <script>
  10. import { mapState } from 'vuex'
  11. export default {
  12. props: {
  13. scorlltop: {
  14. default: () => [],
  15. type: String
  16. }
  17. },
  18. computed: {
  19. ...mapState({
  20. language: state => state.language.current
  21. })
  22. }
  23. }
  24. </script>
  25. <style lang="scss" scoped>
  26. $lw: 220px;
  27. $cw: 440px;
  28. $encw: 430px;
  29. .outer{
  30. overflow: hidden;
  31. max-height: 100%;
  32. height: calc(100vh - 380px);
  33. width: 440px;
  34. text-align: center;
  35. position: relative;
  36. &.isEn {
  37. width:410px;
  38. }
  39. }
  40. .ff-scrollbar{
  41. height: calc(100vh - 380px);
  42. position: absolute;
  43. right: 0;
  44. top: 0;
  45. width: 10px;
  46. background: none;
  47. }
  48. .ff-scroll-thumb{
  49. height: 50px;
  50. width: 5px;
  51. background-color: rgba(221, 221, 221, 0.2);
  52. border-radius: 5px;
  53. position: absolute;
  54. top: 0;
  55. right: 0;
  56. }
  57. </style>