Skip to content

Commit 52f8661

Browse files
authored
Merge pull request #2 from raftx24/feature/add-resize-observer
added resizeObserver
2 parents d17b778 + bfb5d3a commit 52f8661

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"homepage": "https://github.com/Akryum/vue-virtual-scroller#readme",
3535
"dependencies": {
3636
"scrollparent": "^2.0.1",
37-
"vue-observe-visibility": "^0.4.4"
37+
"vue-observe-visibility": "^0.4.4",
38+
"vue-resize": "^0.4.5"
3839
},
3940
"peerDependencies": {
4041
"vue": "^2.6.11"

src/components/RecycleScroller.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
name="after"
4848
/>
4949
</div>
50+
51+
<ResizeObserver @notify="handleResize" />
5052
</div>
5153
</template>
5254

@@ -56,14 +58,18 @@ import ScrollParent from 'scrollparent'
5658
import config from '../config'
5759
import { props, simpleArray } from './common'
5860
import { supportsPassive } from '../utils'
59-
61+
import { ResizeObserver } from 'vue-resize'
6062
let uid = 0
6163
6264
export default {
6365
name: 'RecycleScroller',
6466
67+
components: {
68+
ResizeObserver
69+
},
70+
6571
directives: {
66-
ObserveVisibility,
72+
ObserveVisibility
6773
},
6874
6975
props: {

0 commit comments

Comments
 (0)