Skip to content

Commit ea35fcd

Browse files
author
egoist
committed
update README
1 parent 2006ac7 commit ea35fcd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
[![NPM download](https://img.shields.io/npm/dm/vue-preload.svg?style=flat-square)](https://www.npmjs.com/package/vue-preload)
55
[![David Status](https://img.shields.io/david/egoist/vue-preload.svg?style=flat-square)](https://david-dm.org/egoist/vue-preload)
66

7-
Preloading data like a pro.
8-
97
## How does it work
108

119
Like what [InstantClick](http://instantclick.io/) said, before visitors click on a link, they hover over that link. Between these two events, 200 ms to 300 ms usually pass by. InstantClick makes use of that time to preload the page, so that the page is already there when you click.
@@ -29,6 +27,8 @@ Then replace your `v-on:click="handleClick"` with `v-preload="handleClick"`, and
2927
...
3028
handleClick(pr) {
3129
fetch.then().then(data => {
30+
// pre-set states
31+
pr.set({title: data.title})
3232
// add the following line to tell it preLoading ends
3333
pr.end()
3434
})

0 commit comments

Comments
 (0)