Skip to content

Commit f80c75a

Browse files
committed
put leading underscores on private props
1 parent d273f3e commit f80c75a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/VirtualList.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div ref:viewport on:scroll='refresh()' style='height: {height};'>
2-
<div ref:container style='padding-top: {top}px; padding-bottom: {bottom}px;'>
2+
<div ref:container style='padding-top: {_top}px; padding-bottom: {_bottom}px;'>
33
{#each visible as item (item.index)}
44
<div class='row'>
55
<svelte:component this={component} {..._props} {...item.data} />
@@ -22,7 +22,7 @@
2222
<script>
2323
export default {
2424
data() {
25-
return { top: 0, bottom: 0, start: 0, end: 0, height: '100%', itemHeight: 0, _props: {} };
25+
return { start: 0, end: 0, height: '100%', itemHeight: 0, _top: 0, _bottom: 0, _props: {} };
2626
},
2727

2828
computed: {
@@ -94,7 +94,7 @@
9494
this.heightMap = items.map(item => itemHeight);
9595
this.set({
9696
end: Math.min(items.length, Math.ceil(viewportHeight / itemHeight)),
97-
bottom: items.length * itemHeight
97+
_bottom: items.length * itemHeight
9898
});
9999
} else {
100100
let height = 0;
@@ -115,7 +115,7 @@
115115
for (; i < items.length; i += 1) this.heightMap[i] = avg;
116116

117117
this.set({
118-
bottom: (items.length - end) * avg
118+
_bottom: (items.length - end) * avg
119119
});
120120
}
121121
},
@@ -158,8 +158,8 @@
158158
for (; i < items.length; i += 1) paddingBottom += this.heightMap[i];
159159

160160
this.set({
161-
top: paddingTop,
162-
bottom: paddingBottom,
161+
_top: paddingTop,
162+
_bottom: paddingBottom,
163163
start: newStart,
164164
end: newEnd
165165
});

0 commit comments

Comments
 (0)