Skip to content

Commit ff43280

Browse files
committed
Update readme.
1 parent b7f244d commit ff43280

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

README.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212

1313
> A vue (2.x) component support big data and infinite loading by using virtual scroll list.
1414
15+
* Tiny and easy to use.
16+
17+
* Big data list and infinite loading.
18+
19+
* Set the initial scroll index or change any.
20+
21+
* List scrolling, to top and bottom can be detected.
22+
1523

1624
## How it works
1725

@@ -22,7 +30,7 @@
2230

2331
* [vue-virtual-scroll-list with 100,000 finite data](https://tangbc.github.io/vue-virtual-scroll-list/examples/finite/).
2432

25-
* [vue-virtual-scroll-list infinite data by increasing 20 each time](https://tangbc.github.io/vue-virtual-scroll-list/examples/infinite/).
33+
* [vue-virtual-scroll-list infinite data by request 20 each time](https://tangbc.github.io/vue-virtual-scroll-list/examples/infinite/).
2634

2735

2836
## Usage
@@ -74,36 +82,37 @@ The `<Item>` component is included inside but defined outside the `<virtualList>
7482
```
7583

7684
```javascript
85+
// Global name as `VirutalScrollList`
86+
Vue.component('virtual-list', VirutalScrollList)
87+
7788
new Vue({
7889
el: '#app',
7990
data: {
8091
items: new Array(100000)
81-
},
82-
components: {
83-
'virtual-list': VirutalScrollList // Global name as `VirutalScrollList`
8492
}
85-
});
93+
})
8694
```
8795

8896
**Notice: list Item component or DOM frag using `v-for` must designate the `:key` property.**
8997

9098

91-
## Support props type
99+
## Props
92100

93101
*Prop* | *Type* | *Required* | *Description* |
94102
:--- | :--- | :--- | :--- |
95103
| size | Number || Each list item height, currently only supports fixed height. |
96104
| remain | Number || How many items except show in virtual-list viewport, so `size` and `remian` will determine the virtual-list outside container height (size × remian). |
105+
| start | Number | * | Default value is `0`, the initial scroll start index. It must be integer and in the range of list index, do nothing but throw a warnning if not match. |
97106
| rtag | String | * | Default value is `div`, the virtual-list's root HTMLElement tag name, in all case it's style is set to `display: block;` |
98107
| wtag | String | * | Default value is `div`, the virtual-list's item wrapper HTMLElement tag name, in all case it's style is set to `display: block;` |
99-
| onScroll | Function | * | Call on virtual-list scroll event hanlding, param: `(e, scrollTop)` |
100-
| toTop | Event | * | An event emit by virtual-list component when the list is scrolled on top. |
101-
| toBottom | Event | * | An event emit by virtual-list component when the list is scrolled on bottom. |
108+
| onscroll | Function | * | Call on virtual-list scroll event hanlding, param: `(e, scrollTop)`. |
109+
| totop | Function | * | A function triggered when the virtual-list is scrolled to top. |
110+
| tobottom | Function | * | A function triggered when the virtual-list is scrolled to bottom. |
102111

103112

104113
## Contributions
105114

106-
Welcome to improve vue-virtual-scroll-list by any pull request or issue!
115+
Welcome to improve vue-virtual-scroll-list by any pull request or issue.
107116

108117

109118
## License

0 commit comments

Comments
 (0)