Skip to content

Commit 304df9f

Browse files
committed
Update readme
1 parent 9847ca7 commit 304df9f

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ https://tangbc.github.io/vue-virtual-scroll-list
5050

5151
## What's new in v2.0
5252

53-
Here are the details of update information [release v2.0](https://github.com/tangbc/vue-virtual-scroll-list/releases/tag/v2.0.0).
53+
Here are the major of update informations with [release v2.0](https://github.com/tangbc/vue-virtual-scroll-list/releases/tag/v2.0.0).
5454

5555
Since the `v2.0` is **not compatible** with `v1.x`, please note before upgrading, `v1.x` documentation see [v1.x.md](https://github.com/tangbc/vue-virtual-scroll-list/blob/master/v1.x.md).
5656

@@ -61,7 +61,7 @@ Since the `v2.0` is **not compatible** with `v1.x`, please note before upgrading
6161
npm install vue-virtual-scroll-list --save
6262
```
6363

64-
Root component is:
64+
Root component:
6565
```vue
6666
<template>
6767
<div>
@@ -75,6 +75,7 @@ Root component is:
7575
/>
7676
</div>
7777
</template>
78+
7879
<script>
7980
import Item from './Item'
8081
import VirtualList from 'vue-virtual-scroll-list'
@@ -93,11 +94,12 @@ Root component is:
9394
</script>
9495
```
9596

96-
Item component is:
97+
Item component:
9798
```vue
9899
<template>
99100
<div>{{ source.text }} - {{ otherPropValue }}</div>
100101
</template>
102+
101103
<script>
102104
export default {
103105
name: 'item-component',
@@ -152,6 +154,18 @@ More usages or getting start you can refer to these clearly [examples](https://t
152154
| `header-class` | String | | For using header slot, header slot wrapper element class name. |
153155
| `footer-class` | String | | For using footer slot, footer slot wrapper element class name. |
154156

157+
### Public methods
158+
159+
Here are some usefull public methods you can call via [`ref`](https://vuejs.org/v2/guide/components-edge-cases.html#Accessing-Child-Component-Instances-amp-Child-Elements):
160+
161+
* `reset()`: reset all state back to initial.
162+
163+
* `scrollToBottom()`: manual set scroll position to bottom.
164+
165+
* `scrollToIndex(index)`: manual set scroll position to a designated index.
166+
167+
* `scrollToOffset(offset)`: manual set scroll position to a designated offset.
168+
155169

156170
## Attentions
157171

0 commit comments

Comments
 (0)