Skip to content

Commit f928581

Browse files
alexsashareganAkryum
authored andcommitted
docs: clarification and spelling updates (#202)
1 parent c6ba015 commit f928581

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,17 @@ Vue.component('RecycleScroller', VueVirtualScroller.RecycleScroller)
113113

114114
There are several components provided by `vue-virtual-scroller`:
115115

116-
[RecycleScroller](#recyclescroller) is a component that only renders the visible item in your list. It also re-use components and dom elements to be the most efficient and performant possible.
116+
[RecycleScroller](#recyclescroller) is a component that only renders the visible items in your list. It also re-uses components and dom elements to be as efficient and performant as possible.
117117

118-
[DynamicScroller](#dynamicscroller) is a component is using RecycleScroller under-the-hood and adds a dynamic size management feature on top of it. The main use case for this is **not knowing the size of the items** in advance: the Dynamic Scroller will automatically "discover" it when it renders new item as the user scrolls.
118+
[DynamicScroller](#dynamicscroller) is a component that wraps the RecycleScroller component and extends its features to include dynamic size management. The main use case for this is when you **do not know the size of the items** in advance. The Dynamic Scroller automatically "discovers" item dimensions as it renders new items during scrolling.
119119

120120
[DynamicScrollerItem](#dynamicscrolleritem) must wrap each item in a DynamicScroller to handle size computations.
121121

122122
[IdState](#idstate) is a mixin that ease the local state management in reused components inside a RecycleScroller.
123123

124124
## RecycleScroller
125125

126-
It's a virtual scroller which only renders the visible items and reuse all the components and DOM trees as the user scrolls.
126+
RecycleScroller is a virtual scroller that only renders the visible items. As the user scrolls, RecycleScroller reuses all components and DOM nodes to maintain optimal performance.
127127

128128
### Basic usage
129129

@@ -170,15 +170,15 @@ export default {
170170
- **⚠️ You need to set the size of the virtual-scroller element and the items elements (for example, with CSS). Unless you are using [variable size mode](#variable-size-mode), all items should have the same height (or width in horizontal mode) to prevent display glitches.**
171171
- **⚠️ If the items are objects, the scroller needs to be able to identify them. By default it will look for an `id` field on the items. This can be configured with the `keyField` prop if you are using another field name.**
172172
- It is not recommended to use functional components inside RecycleScroller since the components are reused (so it will actually be slower).
173-
- The components used in the list should expect `item` prop change without being re-created (use computed props or watchers to properly react to props changes!).
173+
- The list item components must be reactive to the `item` prop being updated without being re-created (use computed props or watchers to properly react to props changes!).
174174
- You don't need to set `key` on list content (but you should on all nested `<img>` elements to prevent load glitches).
175175
- The browsers have a size limitation on DOM elements, it means that currently the virtual scroller can't display more than ~500k items depending on the browser.
176176
- Since DOM elements are reused for items, it's recommended to define hover styles using the provided `hover` class instead of the `:hover` state selector (e.g. `.vue-recycle-scroller__item-view.hover` or `.hover .some-element-inside-the-item-view`).
177177

178178
### How does it work?
179179

180180
- The RecycleScroller creates pools of views to render visible items to the user.
181-
- A view is holding a rendered item, and is reused inside its pool.
181+
- A view holds a rendered item, and is reused inside its pool.
182182
- For each type of item, a new pool is created so that the same components (and DOM trees) are reused for the same type.
183183
- Views can be deactivated if they go off-screen, and can be reused anytime for a newly visible item.
184184

@@ -212,13 +212,13 @@ When the user scrolls inside RecycleScroller, the views are mostly just moved ar
212212

213213
- `items`: list of items you want to display in the scroller.
214214
- `direction` (default: `'vertical'`): scrolling direction, either `'vertical'` or `'horizontal'`.
215-
- `itemSize` (default: `null`): display height (or width in horizontal mode) of the items in pixels used to calculate the scroll size and position. If it set to `null` (the default value), it will use [variable size mode](#variable-size-mode).
215+
- `itemSize` (default: `null`): display height (or width in horizontal mode) of the items in pixels used to calculate the scroll size and position. If it is set to `null` (the default value), it will use [variable size mode](#variable-size-mode).
216216
- `minItemSize`: minimum size used if the height (or width in horizontal mode) of a item is unknown.
217217
- `sizeField` (default: `'size'`): field used to get the item's size in variable size mode.
218-
- `typeField` (default: `'type'`): field used to differenciate different kinds of components in the list. For each distinct type, a pool of recycled items will be created.
219-
- `keyField` (default: `'id'`): field used to identify items and optimize render views management.
218+
- `typeField` (default: `'type'`): field used to differentiate different kinds of components in the list. For each distinct type, a pool of recycled items will be created.
219+
- `keyField` (default: `'id'`): field used to identify items and optimize managing rendered views.
220220
- `pageMode` (default: `false`): enable [Page mode](#page-mode).
221-
- `prerender` (default: `0`): render a fixed number of items for Server-Side Rendering.
221+
- `prerender` (default: `0`): render a fixed number of items for Server-Side Rendering (SSR).
222222
- `buffer` (default: `200`): amount of pixel to add to edges of the scrolling visible area to start rendering items further away.
223223
- `emitUpdate` (default: `false`): emit a `'update'` event each time the virtual scroller content is updated (can impact performance).
224224

@@ -233,7 +233,7 @@ When the user scrolls inside RecycleScroller, the views are mostly just moved ar
233233

234234
- `item`: item being rendered in a view.
235235
- `index`: reflects each item's position in the `items` array
236-
- `active`: is the view active. An active view is considered visible and being positioned by `RecycleScroller`. An inactive view is not considered visible and hidden from the user. Any rendering-related computations should be skipped if the view is inactive.
236+
- `active`: whether or not the view is active. An active view is considered visible and being positioned by `RecycleScroller`. An inactive view is not considered visible and is hidden from the user. Any rendering-related computations should be skipped if the view is inactive.
237237

238238
### Other Slots
239239

@@ -267,7 +267,7 @@ Example:
267267

268268
### Page mode
269269

270-
The page mode expand the virtual-scroller and use the page viewport to compute which items are visible. That way, you can use it in a big page with HTML elements before or after (like a header and a footer). Just set the `page-mode` props to `true`:
270+
The page mode expands the virtual-scroller and uses the page viewport to compute which items are visible. That way, you can use it in a big page with HTML elements before or after (like a header and a footer). Set the `page-mode` prop to `true`:
271271

272272
```html
273273
<header>
@@ -287,7 +287,7 @@ The page mode expand the virtual-scroller and use the page viewport to compute w
287287

288288
**⚠️ This mode can be performance heavy with a lot of items. Use with caution.**
289289

290-
If the `itemSize` prop is not set or set to `null`, the virtual scroller will switch to Variable size mode. You then need to expose a number field on the item objects with the size of the item element.
290+
If the `itemSize` prop is not set or is set to `null`, the virtual scroller will switch to variable size mode. You then need to expose a number field on the item objects with the size of the item element.
291291

292292
**⚠️ You still need to set the size of the items with CSS correctly (with classes for example).**
293293

@@ -339,7 +339,7 @@ The `prerender` props can be set as the number of items to render on the server
339339

340340
## DynamicScroller
341341

342-
This works like RecycleScroller but can render items with unknown sizes!
342+
This works just like the RecycleScroller, but it can render items with unknown sizes!
343343

344344
### Basic usage
345345

@@ -396,21 +396,21 @@ export default {
396396

397397
### Props
398398

399-
All the RecycleScroller props.
399+
Extends all the RecycleScroller props.
400400

401401
- It's not recommended to change `sizeField` prop since all the size management is done internally.
402402

403403
### Events
404404

405-
All the RecycleScroller events.
405+
Extends all the RecycleScroller events.
406406

407407
### Default scoped slot props
408408

409-
All the RecycleScroller scoped slot props.
409+
Extends all the RecycleScroller scoped slot props.
410410

411411
### Other slots
412412

413-
All the RecycleScroller other slots.
413+
Extends all the RecycleScroller other slots.
414414

415415
## DynamicScrollerItem
416416

@@ -419,8 +419,8 @@ The component that should wrap all the items in a DynamicScroller.
419419
### Props
420420

421421
- `item` (required): the item rendered in the scroller.
422-
- `active` (required): is the holding view active in RecleScroller. Will prevent unecessary size recomputation.
423-
- `sizeDependencies`: values that can affest the size of the item. This prop will be watched and if one value changes, the size will be recomputed. Recommended instead of `watchData`.
422+
- `active` (required): is the holding view active in RecycleScroller. Will prevent unnecessary size recomputation.
423+
- `sizeDependencies`: values that can affect the size of the item. This prop will be watched and if one value changes, the size will be recomputed. Recommended instead of `watchData`.
424424
- `watchData` (default: `false`): deeply watch `item` for changes to re-calculate the size (not recommended, can impact performance).
425425
- `tag` (default: `'div'`): element used to render the component.
426426
- `emitResize` (default: `false`): emit the `resize` event each time the size is recomputed (can impact performance).
@@ -431,7 +431,7 @@ The component that should wrap all the items in a DynamicScroller.
431431

432432
## IdState
433433

434-
This is conveniance mixin that can replace `data` in components being rendered in a RecycleScroller.
434+
This is convenience mixin that can replace `data` in components being rendered in a RecycleScroller.
435435

436436
### Why is this useful?
437437

0 commit comments

Comments
 (0)