Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,32 @@
background-color: darken($color5, 3%)
color: $color2
+border-box
.scroll-log
position: absolute
top: 0
z-index: 10
border-radius: 4px
background-color: #dce1de
height: auto
min-width: 320px
max-width: 320px
width: 320px
box-shadow: 0 0 8px #1f2421
padding: 10px 20px
-webkit-box-sizing: border-box
-moz-box-sizing: border-box
box-sizing: border-box
</style>

<template lang="pug">
.component
.scroll-log scrollTop: {{ scrollData.scrollTop }}, scrollLeft: {{ scrollData.scrollLeft }}
v-bar(wrapper="wrapper",
vBar="verticalBarClass",
vBarInternal="verticalBarInternalClass",
hBar="horizontalBarClass",
hBarInternal="horizontalBarInternalClass")
hBarInternal="horizontalBarInternalClass",
@onScroll="userScrollEvent")
.container
.internal
h3.is-marginless Welcome to
Expand Down Expand Up @@ -244,6 +261,7 @@
| <b>optional</b> vBarInternal=""
| <b>optional</b> hBar=""
| <b>optional</b> hBarInternal=""
| <b>optional</b> onScroll=""

h3 To contribute <br> and make it better
h4 Clone the repo,
Expand Down Expand Up @@ -298,7 +316,14 @@
<script>
import VBar from './components/v-bar.vue'
export default {
data: () => ({}),
components: { VBar }
data: () => ({
scrollData: {}
}),
components: { VBar },
methods: {
userScrollEvent (scrollTop, scrollLeft, wrapper) {
this.scrollData = { scrollTop, scrollLeft, wrapper }
}
}
}
</script>
2 changes: 2 additions & 0 deletions src/components/v-bar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,8 @@ export default {
this.wrapperObj.scrollHeight - this.container.scrollHeight !== 0
? (this.container.scrollHeight / this.wrapperObj.scrollHeight) * this.container.scrollHeight
: 0

this.$emit('onScroll', wrapperRef.scrollTop, wrapperRef.scrollLeft, wrapperRef)
}
},
props: ['wrapper', 'vBar', 'vBarInternal', 'hBar', 'hBarInternal']
Expand Down